home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / gfx / 3d / irit50src.lha / irit5 / docs / irit.src (.txt) < prev    next >
Encoding:
LaTeX Document  |  1995-03-15  |  281.1 KB  |  6,914 lines

  1. ;This is the source file to create documentation for the IRIT solid modeler.
  2. ;First character in line specifies the action to take for this line/next block
  3. ;as follows:
  4. ; ';' - a comment that is always ignored.
  5. ; '#' - all lines following this line until next '#' are indented as an array.
  6. ;       Four integers follow specifying indentations, # of elements per
  7. ;       line, whether or not to put an internal vertical separator, and
  8. ;       if entries are row ordered (1) or column ordered (2).
  9. ; '@' - latex only manual. Latex commands can appear within this line.
  10. ; '^' - text/hlp only manual. Opposite of '@'.
  11. ; '!' - plain text and irit docs only manual - keywords/headers.
  12. ; '&' - plain text only manual - headers.
  13. ; '$' - terminator for current block.
  14. ; '*' - prints line in all modes but without any latex filtering on the line.
  15. ; '%' - copied verbatim to all output types.
  16. ; latex commands can appear in regular text limited to a single line as
  17. ; {\command *}. For plain text the {\command } will be filtered out.
  18. ; Escaped characters via '\' (i.e. \#) will be left escaped (\#) in the
  19. ; latex output but unescaped (#) in the plain output.
  20. ;                       IRIT solid modeler (C) Gershon Elber 1991.
  21. @% Irit Solid modeler latex manual.
  22. @% Authors:     Gershon Elber
  23. @% Date:        Thu April 15, 1993
  24. @% Copyright (c) 1991/92/93 Gershon Elber
  25. @\documentstyle[11pt]{article}
  26. @\oddsidemargin  -.2in
  27. @\evensidemargin -.2in
  28. @\textwidth 6.75in
  29. @\topmargin 0.0in
  30. @\textheight 9.5in
  31. @\newcommand{\eqnref}[1]{(\ref{#1})}
  32. @\newcommand{\inner}[2]{\left<{#1}, {#2} \right>}
  33. @\begin{document}
  34. @\pagestyle{empty}
  35. @   \rule{0in}{3in}
  36. @   \begin{center}
  37. @       {\huge\bf _IRIT_VERSION_ User's Manual}\\
  38. @       \vspace{3cm}
  39. @       {\Large A Solid modeling Program}\\
  40. @       \vspace{2cm}
  41. @       {\large Copyright (C) 1989, 1990-1995 Gershon Elber}\\
  42. @       \vspace{1cm}
  43. @       {\large EMail: gershon@cs.technion.ac.il }\\
  44. @       \vspace{2cm}
  45. @       {\large Join {\em IRIT} mailing list: gershon@cs.technion.ac.il }\\
  46. @       {\large Mailing list: irit-mail@cs.technion.ac.il }\\
  47. @       {\large Bug reports: irit-bugs@cs.technion.ac.il }\\
  48. @       \vfill
  49. @       {\small This manual is for IRIT _IRIT_VERSION_.}
  50. @   \end{center}
  51. @\newpage
  52. @\tableofcontents
  53. @\newpage
  54. @\setcounter{page}{1}
  55. @\markright{{\em {\bf Irit Solid modeler}}\hfil G. Elber}
  56. @\pagestyle{myheadings}
  57. @\newpage
  58. ! IRIT _IRIT_VERSION_ User's Manual 
  59. ! A Solid modeling Program 
  60. ^ Copyright (C) 1989, 1990-1995 Gershon Elber
  61. ^ EMail: gershon@cs.technion.ac.il
  62. ^ Join IRIT mailing list: gershon@cs.technion.ac.il
  63. ^ Mailing list: irit-mail@cs.technion.ac.il
  64. ^ Bug reports: irit-bugs@cs.technion.ac.il
  65. @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  66. @\section{Introduction}
  67. !INTRODUCTION
  68.    {\em IRIT} is a solid modeler developed for educational purposes. Although
  69.  small, it is now powerful enough to create quite complex scenes.
  70.    {\em IRIT} started as a polygonal solid modeler and was originally developed
  71.  on an IBM PC under MSDOS. Version 2.0 was also ported to X11 and version 3.0
  72.  to SGI 4D systems. Version 3.0 also includes quite a few free form curves
  73.  and surfaces tools. See the UPDATE.NEW file for more detailed update
  74.  information. In Version 4.0, the display devices were enhanced, freeform
  75.  curves and surfaces have further support, functions can be defined, and
  76.  numerous improvement and optimizations are added.
  77. @\section{Copyrights}
  78. !COPYRIGHTS
  79.    BECAUSE {\em IRIT} AND ITS SUPPORTING TOOLS AS DOCUMENTED IN THIS DOCUMENT
  80.  ARE LICENSED FREE OF CHARGE, I PROVIDE ABSOLUTELY NO WARRANTY, TO THE EXTENT
  81.  PERMITTED BY APPLICABLE STATE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING, I
  82.  GERSHON ELBER PROVIDE THE {\em IRIT} PROGRAM AND ITS SUPPORTING TOOLS "AS IS"
  83.  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
  84.  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
  85.  PARTICULAR PURPOSE.
  86.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THESE PROGRAMS IS WITH
  87.  YOU. SHOULD THE {\em IRIT} PROGRAMS PROVE DEFECTIVE, YOU ASSUME THE COST OF
  88.  ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  89.    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL GERSHON ELBER,
  90.  BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES,
  91.  OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  92.  USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR A
  93.  FAILURE OF THE PROGRAMS TO OPERATE WITH PROGRAMS NOT DISTRIBUTED BY GERSHON
  94.  ELBER) THE PROGRAMS, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF
  95.  SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  96. @\smallskip
  97.    {\em IRIT} is a freeware solid modeler. It is not public domain since I
  98.  hold copyrights on it. However, unless you are to sell or attempt to make
  99.  money from any part of this code and/or any model you made with this solid
  100.  modeler, you are free to make anything you want with it.
  101.    {\em IRIT} can be compiled and executed on numerous Unix systems as well
  102.  as OS2, Windows NT and AmigaDOS. However, beware the MSDOS support is fading
  103.  away.
  104.    You are not obligated to me or to anyone else in any way by using {\em IRIT}.
  105.    You are encouraged to share any model you made with it, but the models
  106.  you made with it are {\em yours}, and you have no obligation to share them.
  107.    You can use this program and/or any model created with it for non
  108.  commercial and non profit purposes only. An acknowledgement on the way the
  109.  models were created would be nice but is {\em not} required.
  110. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  111. @\section{Command Line Options and Set Up of {\em IRIT}}
  112. !SETUP
  113.    The {\em IRIT} program reads a file called {\bf irit.cfg} each time it is executed.
  114.    This file configures the system. It is a regular text file with comments, so
  115.  you can edit it and properly modify it for your environment.
  116.    This file is being searched for in the directory specified by the
  117.  IRIT\_PATH environment variable.
  118.    For example 'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  119.    Note IRIT\_PATH must terminate with '/'. If the variable is not set only
  120.  the current directory is being searched for {\bf irit.cfg}.
  121.    In addition, if it exists, a file by the name of {\bf iritinit.irt} will be
  122.  automatically executed before any other '.irt' file. This file may contain
  123.  any {\em IRIT} command. It is the proper place to put your predefined
  124.  functions and procedures if you have some.
  125.    This file will be searched much the same way {\bf IRIT.CFG} is. The
  126.  name of this initialization file may be changed by setting the StartFile
  127.  entry in the configuration file.
  128.    This file is far more important starting at version 4.0, because of the new
  129.  function and procedure definition that has been added, and which is used
  130.  to emulate BEEP, VIEW, and INTERACT for example.
  131.    The solid modeler can be executed in text mode (see the .cfg and the -t
  132.  flag below) on virtually any system with a C compiler.
  133.   Under all systems the following environment variables must be set
  134.  and updated:
  135. # 14 2 0 1
  136.  path
  137.   Add to path the directory where {\em IRIT}'s binaries are.
  138.  IRIT\_PATH
  139.   Directory with config., help and {\em IRIT}'s binary files.
  140.  IRIT\_DISPLAY
  141.   The graphics driver program/options. Must be in path.
  142.  IRIT\_BIN\_IPC
  143.   If set, uses binary Inter Process Communication.
  144.  For example,
  145. @\begin{verbatim}
  146.    set path = ($path /u/gershon/irit/bin)
  147.    setenv IRIT_PATH  /u/gershon/irit/bin/
  148.    setenv IRIT_DISPLAY "xgldrvs -s-"
  149.    setenv IRIT_BIN_IPC 1
  150. @\end{verbatim}
  151.  to set /u/gershon/irit/bin as the binary directory and to use the sgi's
  152.  gl driver. If IRIT\_DISPLAY is not set, the server (i.e., the {\em IRIT}
  153.  program) will prompt and wait for you to run a client (i.e., a display
  154.  driver). if IRIT\_PATH is not set, none of the configuration files, nor
  155.  the help file will be found.
  156.  If IRIT\_BIN\_IPC is not set, text based IPC is used, which is far
  157.  slower. No real reason not to use IRIT\_BIN\_IPC, unless it does not
  158.  work for you.
  159.   In addition, the following optional environment variables may be set.
  160. # 17 2 0 1
  161.  IRIT\_MALLOC
  162.   If set, apply dynamic memory consistency testing.
  163.   Programs will execute much slower in this mode.
  164.  IRIT\_NO\_SIGNALS
  165.   If set, no signals are caught by IRIT.
  166.  IRIT\_SERVER\_HOST
  167.   Internet Name of IRIT server (used by graphics driver).
  168.  IRIT\_SERVER\_PORT
  169.   Used internally to the TCP socket number. Should not
  170.   be set by users.
  171.  For example,
  172. @\begin{verbatim}
  173.    setenv IRIT_MALLOC 1
  174.    setenv IRIT_NO_SIGNALS 1
  175.    setenv IRIT_SERVER_HOST irit.cs.technion.ac.il
  176. @\end{verbatim}
  177.  IRIT\_MALLOC is useful for programmers, or when reporting a memory
  178.  fatal error occurrence. IRIT\_NO\_SIGNALS is also useful for debugging
  179.  when contorl-C is used within a debugger. The IRIT\_SERVER\_HOST/PORT
  180.  controls the server/client ({\em IRIT}/Display device) communication.
  181.  IRIT\_SERVER\_HOST and IRIT\_SERVER\_PORT are used in the unix and
  182.  Window NT ports of {\em IRIT}.
  183.    See the section on the graphics drivers for more details.
  184.    A session can be logged into a file as set via LogFile in the configuration
  185.  file. See also the LOGFILE command.
  186.    The following command line options are available:
  187. @\begin{verbatim}
  188.    IRIT [-t] [-z] [file.irt]
  189. @\end{verbatim}
  190. # 10 2 1 1
  191.    Puts {\em IRIT} into text mode. No graphics will be displayed and
  192.    the display commands will be ignored. Useful when one needs to
  193.    execute an irt file to create data on a tty device...
  194.    Prints usage message and current configuration/version
  195.    information.
  196.  file.irt
  197.    A file to invoke directly instead of waiting to input from
  198.    stdin.
  199. @\subsection{IBM PC OS2 Specific Set Up}
  200.  Under OS2 the IRIT\_DISPLAY environment variable must be set (if set) to
  201.  os2drvs.exe without any option (-s- will be passed automatically).
  202.  os2drvs.exe must be in a directory that is in the PATH environment
  203.  variable. IRIT\_BIN\_IPC can be used to signal binary IPC which is faster.
  204.  Here is a complete example:
  205. @\begin{verbatim}
  206. %set IRIT_PATH=c:\irit\bin\
  207.  set IRIT_DISPLAY=os2drvs.exe
  208.  set IRIT_BIN_IPC=1
  209. @\end{verbatim}
  210.  assuming the directory specified by IRIT\_PATH holds the executables of
  211.  IRIT and is in PATH.
  212.  If IRIT\_BIN\_IPC is not set, text based IPC is used which is far
  213.  slower. No real reason not to use IRIT\_BIN\_IPC unless it does not
  214.  work for you.
  215. @\subsection{IBM PC Window NT Specific Set Up}
  216.  The NT port uses sockets and is, in this respect, similar to the unix port.
  217.  The envirnoment variables IRIT\_DISPLAY, IRIT\_SERVER\_HOST,
  218.  IRIT\_BIN\_IPC should all be set in a similar way to the Unix specific setup.
  219.  As a direct result, the server (IRIT) and the display device may be running
  220.  on different hosts. For example the server might be running on an NT system
  221.  while the display device will be running on an SGI4D exploiting the graphic's
  222.  hardware capabilities.
  223. @\subsection{Unix Specific Set Up}
  224.    Under UNIX using X11 (x11drvs driver) add the following options to
  225.  your .Xdefaults. Most are self explanatory. The Trans attributes control
  226.  the transformation window, while the View attributes control the view window.
  227.  SubWin attributes control the subwindows within the Transformation window.
  228. # 33 2 0 1
  229.  \#if COLOR
  230.  irit*Trans*BackGround:
  231.   NavyBlue
  232.  irit*Trans*BorderColor:
  233.   Red
  234.  irit*Trans*BorderWidth:
  235.  irit*Trans*TextColor:
  236.   Yellow
  237.  irit*Trans*SubWin*BackGround:
  238.   DarkGreen
  239.  irit*Trans*SubWin*BorderColor:
  240.   Magenta
  241.  irit*Trans*Geometry:
  242.   =150x500+500+0
  243.  irit*Trans*CursorColor:
  244.   Green
  245.  irit*View*BackGround:
  246.   NavyBlue
  247.  irit*View*BorderColor:
  248.   Red
  249.  irit*View*BorderWidth:
  250.  irit*View*Geometry:
  251.   =500x500+0+0
  252.  irit*View*CursorColor:
  253.   Red
  254.  irit*MaxColors:
  255.  \#else
  256.  irit*Trans*Geometry:
  257.   =150x500+500+0
  258.  irit*Trans*BackGround:
  259.   Black
  260.  irit*View*Geometry:
  261.   =500x500+0+0
  262.  irit*View*BackGround:
  263.   Black
  264.  irit*MaxColors:
  265.  \#endif
  266. @\section{First Usage}
  267. !FIRSTUSAGE
  268.    Commands to {\em IRIT} are entered using a textual interface, usually
  269.  from the same window the program was executed from.
  270.    Some important commands to begin with are,
  271.    1. include("file.irt"); - will execute the commands in file.irt. Note
  272.       include can be recursive up to 10 levels. To execute the demo
  273.       (demo.irt) simply type 'include("demo.irt");'. Another way to run
  274.       the demo is by typing demo(); which is a predefined procedure defined
  275.       in iritinit.irt.
  276.    2. help(""); - will print all available commands and how to get help on
  277.       them. A file called irit.hlp will be searched as irit.cfg is
  278.       being searched (see above), to provide the help.
  279.    3. exit(); - close everything and exit {\em IRIT}.
  280.    Most operators are overloaded. This means that you can multiply
  281.  two scalars (numbers), or two vectors, or even two matrices, with the same
  282.  multiplication operator ($*$). To get the on-line help on the
  283.  operator '$*$' type 'help("$*$");'
  284.    The best way to learn this program (like any other program...) is by
  285.  trying it. Print the manual and study each of the commands available.
  286.    Study the demo programs ($*$.irt) provided as well.
  287.    The "best" mode to use irit is via the emacs editor. With this distribution
  288.  an emacs mode for irit files (irt postfix) is provided (irit.el). Make your
  289.  .emacs load this file automatically. Loading file.irt will switch emacs into
  290.  Irit mode that supports the following three keystrokes:
  291. # 18 2 1 1
  292.  Meta-E
  293.   Executes the current line
  294.  Meta-R
  295.   Executes the current Region (Between Cursor and Mark)
  296.  Meta-S
  297.   Executes a single line from input buffer
  298.    The first time one of the above keystrokes is hit, emacs will fork an Irit
  299.  process so that Irit's stdin is controlled via the above commands.
  300.    This emacs mode was tested under various unix environments and under OS2
  301.  2.x.
  302. @\section{Data Types}
  303. !DATATYPES
  304.   These are the Data Types recognized by the solid modeler. They are also
  305.  used to define the calling sequences of the different functions below:
  306. # 18 2 1 1
  307.  {\bf ConstantType}
  308.   Scalar real type that cannot be modified.
  309.  {\bf NumericType}
  310.   Scalar real type.
  311.  {\bf VectorType}
  312.   3D real type vector.
  313.  {\bf PointType}
  314.   3D real type point.
  315.  {\bf CtlPtType}
  316.   Control point of a freeform curve or surface.
  317.  {\bf MatrixType}
  318.   4 by 4 matrix (homogeneous transformation matrix).
  319.  {\bf PolygonType}
  320.   Object consists of polygons.
  321.  {\bf PolylineType}
  322.   Object consists of polylines.
  323.  {\bf CurveType}
  324.   Object consists of curves.
  325.  {\bf SurfaceType}
  326.   Object consists of surfaces.
  327.  {\bf TrimSrfType}
  328.   Object consists of trimmed surfaces.
  329.  {\bf TrivarType}
  330.   Object consists of trivariate function.
  331.  {\bf GeometricType}
  332.   One of Polygon/lineType, CurveType, SurfaceType,
  333.   TrimSrfType, TrivarType.
  334.  {\bf GeometricTreeType}
  335.   A list of GeometricTypes or GeometricTreeTypes.
  336.  {\bf StringType}
  337.   Sequence of chars within double quotes - "A string".
  338.   Current implementation is limited to 80 chars.
  339.  {\bf AnyType}
  340.   Any of the above.
  341.  {\bf ListType}
  342.   List of (any of the above type) objects. List 
  343.   size is dynamically increased, as needed.
  344.   Although points and vectors are not the same, {\em IRIT} does not
  345.  destinguish between them, most of the time. This might change in the future.
  346. @\section{Commands summary}
  347. !COMMANDS
  348.  These are all the commands and operators supported by the {\em IRIT} solid
  349.  modeler:
  350. # 11 6 1 0
  351.  \verb+^+
  352.  $==$
  353.  $!=$
  354.  $<=$
  355.  $>=$
  356.  ACOS
  357.  ADAPISO
  358.  AREA
  359.  ASIN
  360.  ATAN
  361.  ATAN2
  362.  ATTRIB
  363.  AOFFSET
  364.  BOOLONE
  365.  BOOLSUM
  366.  BSP2BZR
  367.  BZR2BSP
  368.  CBEZIER
  369.  CBSPLINE
  370.  CCINTER
  371.  CCRVTR
  372.  CDERIVE
  373.  CDIVIDE
  374.  CEDITPT
  375.  CEVAL
  376.  CEVOLUTE
  377.  CEXTREMES
  378.  CHDIR
  379.  CINFLECT
  380.  CINTERP
  381.  CIRCLE
  382.  CIRCPOLY
  383.  CLNTCLOSE
  384.  CLNTEXEC
  385.  CLNTREAD
  386.  CLNTWRITE
  387.  CMESH
  388.  CMORPH
  389.  CMULTIRES
  390.  COERCE
  391.  COLOR
  392.  COMMENT
  393.  CON2
  394.  CONE
  395.  CONVEX
  396.  COORD
  397.  COMPOSE
  398.  CPOLY
  399.  CRAISE
  400.  CREFINE
  401.  CREGION
  402.  CREPARAM
  403.  CROSSEC
  404.  CRVLNDST
  405.  CRVPTDST
  406.  CSURFACE
  407.  CTANGENT
  408.  CTLPT
  409.  CTRIMSRF
  410.  CYLIN
  411.  CZEROS
  412.  ERROR
  413.  EXIT
  414.  EXTRUDE
  415.  FFCOMPAT
  416.  FFEXTREME
  417.  FREE
  418.  FUNCTION
  419.  GBOX
  420.  GETLINE
  421.  GPOLYGON
  422.  GPOLYLINE
  423.  HELP
  424.  HOMOMAT
  425.  INCLUDE
  426.  INTERACT
  427.  IRITSTATE
  428.  LIST
  429.  LOAD
  430.  LOFFSET
  431.  LOGFILE
  432.  MERGEPOLY
  433.  MESHSIZE
  434.  MOMENT
  435.  MSLEEP
  436.  OFFSET
  437.  PAUSE
  438.  PCIRCLE
  439.  PDOMAIN
  440.  POLY
  441.  PRINTF
  442.  PRISA
  443.  PROCEDURE
  444.  RANDOM
  445.  RMATTR
  446.  ROTX
  447.  ROTY
  448.  ROTZ
  449.  RULEDSRF
  450.  SAVE
  451.  SBEZIER
  452.  SBSPLINE
  453.  SCALE
  454.  SCRVTR
  455.  SDERIVE
  456.  SDIVIDE
  457.  SEDITPT
  458.  SEVAL
  459.  SFROMCRVS
  460.  SINTERP
  461.  SIZEOF
  462.  SMERGE
  463.  SMORPH
  464.  SNOC
  465.  SNORMAL
  466.  SNRMLSRF
  467.  SPHERE
  468.  SQRT
  469.  SRAISE
  470.  SREFINE
  471.  SREGION
  472.  SREPARAM
  473.  STANGENT
  474.  STRIMSRF
  475.  STRIVAR
  476.  SURFPREV
  477.  SURFREV
  478.  SWEEPSRF
  479.  SWPSCLSRF
  480.  SYMBCPROD
  481.  SYMBDIFF
  482.  SYMBDPROD
  483.  SYMBPROD
  484.  SYMBSUM
  485.  SYSTEM
  486.  TBEZIER
  487.  TBSPLINE
  488.  TDERIVE
  489.  TEVAL
  490.  TIME
  491.  TINTERP
  492.  THISOBJ
  493.  TORUS
  494.  TRANS
  495.  TREFINE
  496.  TREGION
  497.  TRIMSRF
  498.  TSUBDIV
  499.  VARLIST
  500.  VECTOR
  501.  VIEW
  502.  VIEWOBJ
  503.  VOLUME
  504. @\section{Functions and Variables}
  505. !FUNCTIONS
  506. @ This section lists all the functions supported by the {\em IRIT} system
  507. @ according to their classes - mostly, the object type they return.
  508.  Functions that return a {\bf NumericType}:
  509. # 11 5 1 0
  510.  ACOS
  511.  AREA
  512.  ASIN
  513.  ATAN
  514.  ATAN2
  515.  CLNTEXEC
  516.  CPOLY
  517.  MESHSIZE
  518.  RANDOM
  519.  SIZEOF
  520.  SQRT
  521.  THISOBJ
  522.  VOLUME
  523.  Functions that return a {\bf GeometricType}:
  524. # 11 6 1 0
  525.  ADAPISO
  526.  AOFFSET
  527.  BOOLONE
  528.  BOOLSUM
  529.  BSP2BZR
  530.  BZR2BSP
  531.  CBEZIER
  532.  CBSPLINE
  533.  CCINTER
  534.  CCRVTR
  535.  CDERIVE
  536.  CDIVIDE
  537.  CEDITPT
  538.  CEVAL
  539.  CEVOLUTE
  540.  CEXTREMES
  541.  CINFLECT
  542.  CINTERP
  543.  CIRCLE
  544.  CIRCPOLY
  545.  CLNTREAD
  546.  CMESH
  547.  CMORPH
  548.  CMULTIRES
  549.  COERCE
  550.  COMPOSE
  551.  CON2
  552.  CONE
  553.  CONVEX
  554.  COORD
  555.  CPOLY
  556.  CRAISE
  557.  CREFINE
  558.  CREGION
  559.  CREPARAM
  560.  CROSSEC
  561.  CRVLNDST
  562.  CRVPTDST
  563.  CSURFACE
  564.  CTANGENT
  565.  CTRIMSRF
  566.  CTLPT
  567.  CYLIN
  568.  CZEROS
  569.  EXTRUDE
  570.  FFCOMPAT
  571.  FFEXTREME
  572.  GBOX
  573.  GETLINE
  574.  GPOLYGON
  575.  GPOLYLINE
  576.  LOFFSET
  577.  MERGEPOLY
  578.  MOMENT
  579.  OFFSET
  580.  PCIRCLE
  581.  PDOMAIN
  582.  POLY
  583.  PRISA
  584.  PROCEDURE
  585.  RULEDSRF
  586.  SBEZIER
  587.  SBSPLINE
  588.  SCRVTR
  589.  SDERIVE
  590.  SDIVIDE
  591.  SEDITPT
  592.  SEVAL
  593.  SFROMCRVS
  594.  SINTERP
  595.  SMERGE
  596.  SMORPH
  597.  SNORMAL
  598.  SNRMLSRF
  599.  SPHERE
  600.  SRAISE
  601.  SREFINE
  602.  SREGION
  603.  SREPARAM
  604.  STANGENT
  605.  STRIMSRF
  606.  STRIVAR
  607.  SURFPREV
  608.  SURFREV
  609.  SWEEPSRF
  610.  SWPSCLSRF
  611.  SYMBCPROD
  612.  SYMBDIFF
  613.  SYMBDPROD
  614.  SYMBPROD
  615.  SYMBSUM
  616.  TBEZIER
  617.  TBSPLINE
  618.  TDERIVE
  619.  TEVAL
  620.  TINTERP
  621.  TORUS
  622.  TREFINE
  623.  TREGION
  624.  TRIMSRF
  625.  TSUBDIV
  626.  Functions that create linear transformation matrices:
  627. # 11 6 1 0
  628.  HOMOMAT
  629.  ROTX
  630.  ROTY
  631.  ROTZ
  632.  SCALE
  633.  TRANS
  634.  Miscellaneous functions:
  635. # 11 6 1 0
  636.  ATTRIB
  637.  CHDIR
  638.  CLNTCLOSE
  639.  CLNTWRITE
  640.  COLOR
  641.  COMMENT
  642.  ERROR
  643.  EXIT
  644.  FREE
  645.  FUNCTION
  646.  HELP
  647.  INCLUDE
  648.  INTERACT
  649.  IRITSTATE
  650.  LIST
  651.  LOAD
  652.  LOGFILE
  653.  MSLEEP
  654.  PAUSE
  655.  PRINTF
  656.  PROCEDURE
  657.  RMATTR
  658.  SAVE
  659.  SNOC
  660.  SYSTEM
  661.  TIME
  662.  VARLIST
  663.  VECTOR
  664.  VIEW
  665.  VIEWOBJ
  666.  Variables that are predefined in the system:
  667. # 18 4 1 0
  668.  AXES
  669.  DRAWCTLPT
  670.  FLAT4PLY
  671.  MACHINE
  672.  POLY\_APPROX\_OPT
  673.  POLY\_APPROX\_UV
  674.  POLY\_APPROX\_TOL
  675.  PRSP\_MAT
  676.  RESOLUTION
  677.  VIEW\_MAT
  678.  Constants that are predefined in the system:
  679. # 13 5 1 0
  680.  AMIGA
  681.  APOLLO
  682.  BLACK
  683.  BLUE
  684.  CTLPT\_TYPE
  685.  CURVE\_TYPE
  686.  CYAN
  687.  DEPTH
  688.  FALSE
  689.  GREEN
  690.  IBMOS2
  691.  IBMNT
  692.  KV\_FLOAT
  693.  KV\_OPEN
  694.  LIST\_TYPE
  695.  MAGENTA
  696.  MATRIX\_TYPE
  697.  MSDOS
  698.  NUMERIC\_TYPE
  699.  PARAM\_CENTRIP
  700.  PARAM\_CHORD
  701.  PARAM\_UNIFORM
  702.  PLANE\_TYPE
  703.  POINT\_TYPE
  704.  POLY\_TYPE
  705.  STRING\_TYPE
  706.  SURFACE\_TYPE
  707.  TRIMSRF\_TYPE
  708.  TRIVAR\_TYPE
  709.  TRUE
  710.  UNDEF\_TYPE
  711.  UNIX
  712.  VECTOR\_TYPE
  713.  WHITE
  714.  YELLOW
  715. @\section{Language description}
  716. !LANGUAGE
  717.     The front end of the {\em IRIT} solid modeler is an infix parser that
  718.  mimics some of the C language behavior. The infix operators that are supported
  719.  are plus (+), minus (-), multiply (*), divide (/), and power (\verb+^+), for
  720.  numeric operators, with the same precedence as in C.
  721.     However, unlike the C language, these operators are overloaded,
  722. @\footnote{In fact the C language does support overloaded operators to some
  723. @extent: '1 + 2' and '1.0 + 2.0' implies invocation of two different
  724. @actions.}
  725.  or different action is taken, based upon the different operands.
  726.    This means that one can write '1 + 2', in which the plus sign denotes a
  727.  numeric addition, or one can write 'PolyObj1 + PolyObj2', in which case the
  728.  plus sign denotes the Boolean operation of a union between two geometric
  729.  objects.
  730.    The exact way each operator is overloaded is defined below.
  731.    In this environment, reals, integers, and even Booleans, are all represented
  732.  as real types. Data are automatically promoted as necessary.
  733.    For example, the constants TRUE and FALSE are defined as 1.0 and 0.0
  734.  respectively.
  735.    Each expression is terminated by a semicolon. An expression can be as
  736.  simple as 'a;' which prints the value of variable a, or as complex as:
  737. @\begin{verbatim}
  738.     for ( t = 1.1, 0.1, 1.9,
  739.             cb1 = csurface( sb, COL, t ):
  740.             color( cb1, green ):
  741.             snoc( cb1, cb_all )
  742.         );
  743. @\end{verbatim}
  744.    While an expression is terminated with a semicolon, a colon is used to
  745.  terminate mini-expressions within an expression.
  746.    Once a complete expression is read in (i.e., a semicolon is detected)
  747.  and parsed correctly (i.e. no syntax errors are found), it is executed.
  748.    Before each operator or a function is executed, parameter type matching
  749.  tests are made to make sure the operator can be applied to these
  750.  operand(s), or that the function gets the correct set of arguments.
  751.    The parser is totally case insensitive, so Obj, obj, and OBJ will refer
  752.  to the same object, while MergePoly, MERGEPOLY, and mergePoly will refer
  753.  to the same function.
  754.    Objects (Variables if you prefer) need not be declared. Simply use them
  755.  when you need them. Object names may be any alpha-numeric (and underscore)
  756.  string of at most 30 characters. By assigning to an old object, the old
  757.  object will be automatically deleted and if necessary its type will be
  758.  modified on the fly.
  759.  Example:
  760. @\begin{verbatim}
  761.     V = sin( 45 * pi / 180.0 );
  762.     V = V * vector( 1, 2, 3 );
  763.     V = V * rotx( 90 );
  764.     V = V * V;
  765. @\end{verbatim}
  766.  will assign to V a NumericType equal to the sine of 45 degrees, the VectorType
  767.  ( 1, 2, 3 ) scaled by the sine of 45, rotate that vector around the X axis
  768.  by 90 degrees, and finally a NumericType which is the dot (inner) product of
  769.  V with itself.
  770.    The parser will read from stdin, unless a file is specified on the command
  771.  line or an INCLUDE command is executed. In both cases, when the end of file
  772.  is encountered, the parser will again wait for input from stdin. In order
  773.  to execute a file and quit in the end of the file, put an EXIT command as
  774.  the last command in the file.
  775. @\section{Operator overloading}
  776. @ The basic operators $+$, $-$, $*$, $/$, and \verb+^+ are overloaded.
  777. @ This section describes what action is taken by each of these operators
  778. @ depending on its arguments.
  779. @\subsection{Overloading $+$}
  780.  The $+$ operator is overloaded above the following domains:
  781. @\begin{verbatim}
  782.   NumericType + NumericType -> NumericType
  783.   VectorType  + VectorType  -> VectorType   (Vector addition)
  784.   MatrixType  + MatrixType  -> MatrixType   (Matrix addition)
  785.   PolygonType + PolygonType -> PolygonType  (Boolean UNION operation)
  786.   CurveType   + CurveType   -> CurveType    (Curve curve profiling)
  787.   CurveType   + CtlPtType   -> CurveType    (Curve control point profiling)
  788.   CtlPtType   + CtlPtType   -> CurveType    (Control points profiling)
  789.   ListType    + ListType    -> ListType     (Append lists operator)
  790.   StringType  + StringType  -> StringType   (String concat)
  791.   StringType  + RealType    -> StringType   (String concat, real as int string)
  792. @\end{verbatim}
  793.  Note: Boolean UNION of two disjoint objects (no common volume) will result
  794.  with the two objects combined. It is the USER responsibility to make sure that
  795.  the non intersecting objects are also disjoint - this system only tests for
  796.  no intersection.
  797. @\subsection{Overloading $-$}
  798.  The $-$ operator is overloaded above the following domains:
  799.  As a binary operator:
  800. @\begin{verbatim}
  801.   NumericType - NumericType -> NumericType
  802.   VectorType  - VectorType  -> VectorType   (Vectoric difference)
  803.   MatrixType  - MatrixType  -> MatrixType   (Matrix difference) 
  804.   PolygonType - PolygonType -> PolygonType  (Boolean SUBTRACT operation)
  805. @\end{verbatim}
  806.  As a unary operator:
  807. @\begin{verbatim}
  808.   - NumericType -> NumericType
  809.   - VectorType  -> VectorType    (Scale vector by -1)
  810.   - MatrixType  -> MatrixType    (Scale matrix by -1)
  811.   - PolygonType -> PolygonType   (Boolean NEGATION operation)
  812.   - CurveType   -> CurveType     (Curve parameterization is reversed)
  813.   - SurfaceType -> SurfaceType   (Surface parameterization is reversed)
  814. @\end{verbatim}
  815.  Note: Boolean SUBTRACT of two disjoint objects (no common volume) will result
  816.  with an empty object. For both a curve and a surface parameterization, reverse
  817.  operation (binary minus) causes the object normal to be flipped as a side
  818.  effect.
  819. @\subsection{Overloading $*$}
  820.  The $*$ operator is overloaded above the following domains:
  821. @\begin{verbatim}
  822.   NumericType * NumericType   -> NumericType
  823.   VectorType  * NumericType   -> VectorType    (Vector scaling)
  824.   VectorType  * VectorType    -> NumericType   (Inner product)
  825.   MatrixType  * NumericType   -> MatrixType    (Matrix Scaling)
  826.   MatrixType  * PointType     -> PointType     (Point transformation)
  827.   MatrixType  * CtlPtType     -> CtlPtType     (Ctl Point transformation)
  828.   MatrixType  * VectorType    -> VectorType    (Vector transformation)
  829.   MatrixType  * MatrixType    -> MatrixType    (Matrix multiplication)
  830.   MatrixType  * GeometricType -> GeometricType (Object transformation)
  831.   MatrixType  * ListType      -> ListType      (Object hierarchy transform.)
  832.   PolygonType * PolygonType   -> PolygonType   (Boolean INTERSECTION operation)
  833. @\end{verbatim}
  834.  Note: Boolean INTERSECTION of two disjoint objects (no common volume) will
  835.  result with an empty object. Object hierarchy transform transforms any
  836.  transformable object (GeometricType) found in the list recursively.
  837. @\subsection{Overloading $/$}
  838.  The $/$ operator is overloaded above the following domains:
  839. @\begin{verbatim}
  840.   NumericType / NumericType -> NumericType
  841.   PolygonType / PolygonType -> PolygonType   (Boolean CUT operation)
  842. @\end{verbatim}
  843.  Note: Boolean CUT of two disjoint objects (no common volume) will result
  844.  with an empty object.
  845. @\subsection{Overloading \^{\ }}
  846.  The \verb+^+ operator is overloaded above the following domains:
  847. @\begin{verbatim}
  848.   NumericType ^ NumericType -> NumericType
  849.   VectorType  ^ VectorType  -> VectorType  (Cross product)
  850.   MatrixType  ^ NumericType -> MatrixType  (Matrix to the (int) power)
  851.   PolygonType ^ PolygonType -> PolygonType (Boolean MERGE operation)
  852.   StringType  ^ StringType  -> StringType  (String concat)
  853.   StringType  ^ RealType    -> StringType  (String concat, real as real string)
  854. @\end{verbatim}
  855.  Note: Boolean MERGE simply merges the two sets of polygons without any
  856.  intersection tests. Matrix powers must be positive integers or -1, in which
  857.  case the matrix inverse (if it exists) is computed.
  858. @\subsection{Assignments}
  859.    Assignments are allowed as side effects, in any place in an expression.
  860.  If "Expr" is an expression, then "var = Expr" is the exact same expression
  861.  with the side effect of setting Var to that value. There is no guarantee
  862.  on the order of evaluation, so using Vars that are set within the same
  863.  expression is a bad practice. Use parentheses to force the order of
  864.  evaluation, i.e., "( var = Expr )".
  865. @\subsection{Comparison operators $==$, $!=$, $<$, $>$, $<=$, $>=$}
  866. &Comparison operators ==, !=, <, >, <=, >=
  867.  The conditional comparison operators can be applied to the following
  868.  domains (o for a comparison operator):
  869. @\begin{verbatim}
  870.   NumericType o NumericType -> NumericType
  871.   StringType  o StringType  -> NumericType
  872.   PointType   o PointType   -> NumericType
  873.   VectorType  o VectorType  -> NumericType
  874.   PlaneType   o PlaneType   -> NumericType
  875. @\end{verbatim}
  876.  The returned NumericType is non-zero if the condition holds, or zero if
  877.  not.
  878.    For PointTypes, VectorTypes, and PlaneTypes, only $==$ and $!=$ comparisons
  879.  are valid. This is either the same or different.
  880.    For NumericTypes and StringTypes (uses strcmp) all comparisons are valid.
  881. @\subsection{Logical operators $\&\&$, $\|\|$, !}
  882. &Logical operators &&, ||, !
  883.  Complex logical expressions can be defined using the logical {\em and} ($\&\&$),
  884.  logical {\em or} ($\|\|$) and logical {\em not} (!). These operators can be applied
  885.  to NumericTypes that are considered Boolean results. That is, true for a
  886.  non-zero value, and false otherwise.
  887.    The returned NumericType is true if both operands are true for the {\em and}
  888.  operator, at least one is true for the {\em or} operator, and the operand is
  889.  false for the {\em not} operator. In all other cases, a false is returned.
  890.    To make sure Logical expressions are readable, the {\em and} and {\em or}
  891.  operators are defined to have the {\em same} priority. Use parentheses to
  892.  disambiguate a logical expression and to make it more readable.
  893. @\subsection{Geometric Boolean Operations}
  894. &Geometric Boolean Operations
  895.    The {\em IRIT} solid modeling system supports Boolean operations between
  896.  polyhedra objects. Freeform objects will be automaticaly converted to
  897.  a polygonal representation when used in Boolean operations.
  898.    The $+$, $*$, and $-$ are overloaded to denote Boolean union, intersection
  899.  and subtraction when operating on geometric entities. $-$ can also be
  900.  used as an unary operator to reverse the object orientation inside out.
  901.    Example:
  902. @\begin{verbatim}
  903.     resolution = 20;
  904.     B = box(vector(-1, -1, -0.25), 2, 1.2, 0.5);
  905.     C = con2(vector(0, 0, -1.5), vector(0, 0, 3), 0.7, 0.3);
  906.     D = convex(B - C);
  907.     E = convex(C - B);
  908.     F = convex(B + C);
  909.     G = convex(B * C);
  910.     tr = rotx( -90 ) * roty( 40 ) * rotx( -30 );
  911.     All = list( D * tr * trans( vector(  0.6,  0.5, 0.0 ) ),
  912.                 E * tr * trans( vector(  3.0,  0.0, 0.0 ) ),
  913.                 F * tr * trans( vector( -2.0,  0.0, 0.0 ) ),
  914.                 G * tr * trans( vector(  0.7, -1.0, 0.0 ) ) )
  915.             * scale( vector( 0.25, 0.25, 0.25 ) )
  916.             * trans( vector( -0.1, -0.3, 0.0 ) );
  917.     view_mat = rotx( 0 );
  918.     view( list( view_mat, All ), on );
  919.     save( "booleans", list( view_mat, All ) );
  920. @\end{verbatim}
  921.     A complete example to compute the union, intersection and both
  922.  differences of a box and a truncated cone.
  923. @The result of this example can be seen in Figure~\ref{fig-booleans}
  924. @with its hidden lines removed.
  925. @\begin{figure}
  926. @\vspace{3in}
  927. @\special{psfile=user_man/booleans.ps hscale=100 vscale=100 hoffset=-40 voffset=-130}
  928. @\caption{Geometric Boolean operatioms between a box and a truncated cone.
  929. @         Shown are union (left), intersection (bottom center), box minus
  930. @         the cone (top center), and cone minus the box (right).}
  931. @\label{fig-booleans}
  932. @\end{figure}
  933.     There are several flags to control the Boolean operations. See
  934.  IRITSTATE command for the "InterCrv", "Coplanar", and "PolySort"
  935.  states.
  936. @\subsection{Priority of operators}
  937. &Priority of operators
  938.    The following table lists the priority of the different operators.
  939. # 19 3 0 1
  940.  Lowest
  941.  Operator
  942.  Name of operator
  943.  priority
  944.  comma
  945.  colon
  946.  $\&\&$, $\|\|$
  947.  logical and, logical or
  948.  $=,==,!=,<=,>=,<,>$
  949.  assignment, equal, not equal, less
  950.  equal, greater equal, less, greater
  951.  +, -
  952.  plus, minus
  953.  *, /
  954.  multiply, divide
  955.  Highest
  956.  \verb+^+
  957.  power
  958.  priority
  959.  -, !
  960.  unary minus, logical not
  961. @\subsection{Grammar}
  962. &Grammar
  963.    The grammar of the {\em IRIT} parser follows similar guidelines as
  964.  the C language for simple expressions. However, complex statements differ.
  965.    See the IF, FOR, FUNCTION, and PROCEDURE below for the usage of these
  966.  clauses.
  967. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  968. @\section{Function Description}
  969. &Function Description
  970. @ The description below defines the parameters and returned values of the
  971. @ predefined functions in the system, using the notation of functions
  972. @ in ANSI C. Listed are all the functions in the system, in alphabetic
  973. @ order, according to their classes.
  974. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  975. @\subsection{NumericType returning functions}
  976. &NumericType returning functions
  977. @\subsubsection{ABS}
  978. @\begin{verbatim}
  979.  NumericType ABS( NumericType Operand )
  980. @\end{verbatim}
  981.    Returns the absolute value of the given {\bf Operand}.
  982. @\subsubsection{ACOS}
  983. !ACOS
  984. @\begin{verbatim}
  985.  NumericType ACOS( NumericType Operand )
  986. @\end{verbatim}
  987.    Returns the arc cosine value (in radians) of the given {\bf Operand}.
  988. @\subsubsection{AREA}
  989. !AREA
  990. @\begin{verbatim}
  991.  NumericType AREA( PolygonType Object )
  992. @\end{verbatim}
  993.    Returns the area of the given {\bf Object} (in object units). Returned is
  994.  the area of the polygonal object, not the area of the primitive it might
  995.  approximate.
  996.    This means that the area of a polygonal approximation of a sphere will be
  997.  returned, not the exact area of the sphere.
  998. @\subsubsection{ASIN}
  999. !ASIN
  1000. @\begin{verbatim}
  1001.  NumericType ASIN( NumericType Operand )
  1002. @\end{verbatim}
  1003.    Returns the arc sine value (in radians) of the given {\bf Operand}.
  1004. @\subsubsection{ATAN}
  1005. !ATAN
  1006. @\begin{verbatim}
  1007.  NumericType ATAN( NumericType Operand )
  1008. @\end{verbatim}
  1009.    Returns the arc tangent value (in radians) of the given {\bf Operand}.
  1010. @\subsubsection{ATAN2}
  1011. !ATAN2
  1012. @\begin{verbatim}
  1013.  NumericType ATAN2( NumericType Operand1, NumericType Operand2 )
  1014. @\end{verbatim}
  1015.    Returns the arc tangent value (in radians) of the given ratio:
  1016.  {\bf Operand1} / {\bf Operand2}, over the whole circle.
  1017. @\subsubsection{COS}
  1018. @\begin{verbatim}
  1019.  NumericType COS( NumericType Operand )
  1020. @\end{verbatim}
  1021.    Returns the cosine value of the given {\bf Operand} (in radians).
  1022. @\subsubsection{CLNTEXEC}
  1023. !CLNTEXEC
  1024. @\begin{verbatim}
  1025.  NumericType CLNTEXEC( StringType ClientName )
  1026. @\end{verbatim}
  1027.    Initiate communication channels to a client named {\bf ClientName}.
  1028.  {\bf ClientName} is executed by this function as a sub process and
  1029.  two communication channels are opened between the IRIT server and the
  1030.  new client, for read and write. See also CLNTREAD, CLNTWRITE, and
  1031.  CLNTCLOSE. if {\bf ClientName} is an empty string, the user is provided
  1032.  with the new communication port to be used and the server blocks for the
  1033.  user to manualy executed the client after setting the proper
  1034.  IRIT\_SERVER\_HOST/PORT environment variables.
  1035.  Example:
  1036. @\begin{verbatim}
  1037.    h1 = CLNTEXEC( "" );
  1038.    h2 = CLNTEXEC( "nuldrvs -s-" );
  1039. @\end{verbatim}
  1040.  executes two clients, one is named {\bf nuldrvs} and the other one is
  1041.  prompted for by the user. As a result of the second invokation of
  1042.  CLNTEXEC, the user will be prompted with a message similar to,
  1043. @\begin{verbatim}
  1044.     Irit: Startup your program - I am waiting...
  1045.     setenv IRIT_SERVER_PORT 2182
  1046. @\end{verbatim}
  1047.  and he/she will need to set the proper environment variable and execute
  1048.  their client manually.
  1049. @\subsubsection{CPOLY}
  1050. !CPOLY
  1051. @\begin{verbatim}
  1052.  NumericType CPOLY( PolygonType Object )
  1053. @\end{verbatim}
  1054.    Returns the number of polygons in the given polygonal {\bf Object}.
  1055. @\subsubsection{EXP}
  1056. @\begin{verbatim}
  1057.  NumericType EXP( NumericType Operand )
  1058. @\end{verbatim}
  1059.    Returns the natural exponent value of the given {\bf Operand}.
  1060. @\subsubsection{LN}
  1061. @\begin{verbatim}
  1062.  NumericType LN( NumericType Operand )
  1063. @\end{verbatim}
  1064.    Returns the natural logarithm value of the given {\bf Operand}.
  1065. @\subsubsection{LOG}
  1066. @\begin{verbatim}
  1067.  NumericType LOG( NumericType Operand )
  1068. @\end{verbatim}
  1069.    Returns the base 10 logarithm value of the given {\bf Operand}.
  1070. @\subsubsection{MESHSIZE}
  1071. !MESHSIZE
  1072. @\begin{verbatim}
  1073.  NumericType MESHSIZE( SurfaceType Srf, ConstantType Direction )
  1074. @\end{verbatim}
  1075.    Returns the size of {\bf Srf}'s mesh in {\bf Direction}, which
  1076.  is one of COL or ROW.
  1077.  Example:
  1078. @\begin{verbatim}
  1079.    RSize = MESHSIZE( Sphere, ROW );
  1080.    CSize = MESHSIZE( Sphere, COL );
  1081. @\end{verbatim}
  1082. @\subsubsection{RANDOM}
  1083. !RANDOM
  1084. @\begin{verbatim}
  1085.  NumericType RANDOM( NumericType Min, NumericType Max )
  1086. @\end{verbatim}
  1087.    Returns a randomized value between {\bf Min} and {\bf Max}.
  1088. @\subsubsection{SIN}
  1089. @\begin{verbatim}
  1090.  NumericType SIN( NumericType Operand )
  1091. @\end{verbatim}
  1092.    Returns the sine value of the given {\bf Operand} (in radians).
  1093. @\subsubsection{SIZEOF}
  1094. !SIZEOF
  1095. @\begin{verbatim}
  1096.  NumericType SIZEOF( ListType List | PolyType Poly | CurveType Crv )
  1097. @\end{verbatim}
  1098.    Returns the length of a list, if {\bf List}, the number of polygons
  1099.  if {\bf Poly}, or the length of the control polygon if {\bf Crv}.
  1100.    If, however, only one polygon is in {\bf Poly}, it returns the number
  1101.  of vertices in that polygon.
  1102.  Example:
  1103. @\begin{verbatim}
  1104.    len = SIZEOF( list( 1, 2, 3 ) );
  1105.    numPolys = SIZEOF( axes );
  1106.    numCtlpt = SIZEOF( circle( vector( 0, 0, 0 ), 1 ) );
  1107. @\end{verbatim}
  1108.  will assign the value of 3 to the variable {\bf len}, set {\bf numPolys}
  1109.  to the number of polylines in the axes object, and set numCtlPt to 9, the
  1110.  number of control points in a circle.
  1111. @\subsubsection{SQRT}
  1112. !SQRT
  1113. @\begin{verbatim}
  1114.  NumericType SQRT( NumericType Operand )
  1115. @\end{verbatim}
  1116.    Returns the square root value of the given {\bf Operand}.
  1117. @\subsubsection{TAN}
  1118. @\begin{verbatim}
  1119.  NumericType TAN( NumericType Operand )
  1120. @\end{verbatim}
  1121.    Returns the tangent value of the given {\bf Operand} (in radians).
  1122. @\subsubsection{THISOBJ}
  1123. !THISOBJ
  1124. @\begin{verbatim}
  1125.  NumericType THISOBJ( StringType Object )
  1126. @\end{verbatim}
  1127.    Returns the object type of the given name of an {\bf Object}. This can
  1128.  be one of the constants  UNDEF\_TYPE, NUMERIC\_TYPE, STRING\_TYPE,
  1129.  VECTOR\_TYPE, POINT\_TYPE, CTLPT\_TYPE, MATRIX\_TYPE, POLY\_TYPE,
  1130.  CURVE\_TYPE, SURFACE\_TYPE, TRIMSRF\_TYPE, or TRIVAR\_TYPE.
  1131.    This is also a way to ask if an object by a given name do exist (if the
  1132.  returned type is UNDEF\_TYPE or not).
  1133. @\subsubsection{VOLUME}
  1134. !VOLUME
  1135. @\begin{verbatim}
  1136.  NumericType VOLUME( PolygonType Object )
  1137. @\end{verbatim}
  1138.    Returns the volume of the given {\bf Object} (in object units). It returns
  1139.  the volume of the polygonal object, not the volume of the object it might
  1140.  approximate.
  1141.    This routine decomposes all non-convex polygons to convex ones as a side
  1142.  effect (see CONVEX).
  1143. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1144. @\subsection{GeometricType returning functions}
  1145. &GeometricType returning functions
  1146. @\subsubsection{ADAPISO}
  1147. !ADAPISO
  1148. @\begin{verbatim}
  1149.  CurveType ADAPISO( SurfaceType Srf, NumericType Dir, NumericType Eps,
  1150.                     NumericType FullIso, NumericType SinglePath )
  1151. @\end{verbatim}
  1152.  Constructs a {\em coverage} to {\bf Srf} using isocurve in the {\bf Dir} direction,
  1153.  so that for any point p on surface {\bf Srf}, there exists a point on one of
  1154.  the isocurves that is close to p within {\bf Eps}. If {\bf FullIso}, the
  1155.  extracted isocurves span the entire surface domain, otherwise they may
  1156.  span only a subset of the domain. If {\bf SinglePath}, an approximation to
  1157.  a single path (Hamiltonian path) that visits all isocurves is constructed.
  1158. @\begin{verbatim}
  1159.     srf = sbezier( list( list( ctlpt( E3, -0.5, -1.0,  0.0 ),
  1160.                                ctlpt( E3,  0.4,  0.0,  0.1 ),
  1161.                                ctlpt( E3, -0.5,  1.0,  0.0 ) ),
  1162.                          list( ctlpt( E3,  0.0, -0.7,  0.1 ),
  1163.                                ctlpt( E3,  0.0,  0.0,  0.0 ),
  1164.                                ctlpt( E3,  0.0,  0.7, -0.2 ) ),
  1165.                          list( ctlpt( E3,  0.5, -1.0,  0.1 ),
  1166.                                ctlpt( E3, -0.4,  0.0,  0.0 ),
  1167.                                ctlpt( E3,  0.5,  1.0, -0.2 ) ) ) );
  1168.     aiso = ADAPISO( srf, COL, 0.1, FALSE, FALSE );
  1169. @\end{verbatim}
  1170.  Constructs an adaptive isocurve approximation with tolerance of {\bf 0.1} to
  1171.  surface {\bf srf} in direction {\bf COL}. Isocurves are allowed to span a
  1172.  subset of the surface domain. No single path is needed.
  1173.  The {\bf SinglePath} option is currently not supported.
  1174. @\subsubsection{ARC}
  1175. @\begin{verbatim}
  1176.  CurveType ARC( VectorType StartPos, VectorType Center, VectorType EndPos )
  1177. @\end{verbatim}
  1178.  Constructs an arc between the two end points {\bf StartPos} and {\bf EndPos},
  1179.  centered at {\bf Center}. Arc will always be less than 180 degrees, so the
  1180.  shortest circular path from {\bf StartPos} to {\bf EndPos} is selected. The
  1181.  case where {\bf StartPos}, {\bf Center}, and {\bf EndPos} are collinear is
  1182.  illegal, since it attempts to define a 180 degrees arc. Arc is constructed
  1183.  as a single rational quadratic Bezier curve.
  1184.  Example:
  1185. @\begin{verbatim}
  1186.     Arc1 = ARC( vector( 1.0, 0.0, 0.0 ),
  1187.                 vector( 1.0, 1.0, 0.0 ),
  1188.                 vector( 0.0, 1.0, 0.0 ) );
  1189. @\end{verbatim}
  1190.  constructs a 90 degrees arc, tangent to both the X and Y axes at coordinate 1.
  1191. @See Figure~\ref{fig-arc}.
  1192. @\begin{figure}
  1193. @\vspace{2.4in}
  1194. @\special{psfile=user_man/arc1cnst.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  1195. @\caption{A 90 degree arc constructed using the ARC constructor.}
  1196. @\label{fig-arc}
  1197. @\end{figure}
  1198. @\subsubsection{AOFFSET}
  1199. !AOFFSET
  1200. @\begin{verbatim}
  1201.  CurveType AOFFSET( CurveType Crv, NumericType OffsetDistance,
  1202.                     NumericType Epsilon, NumericType TrimLoops )
  1203.  SurfaceType AOFFSET( SurfaceType Srf NumericType OffsetDistance,
  1204.                       NumericType Epsilon, NumericType TrimLoops )
  1205. @\end{verbatim}
  1206.  Computes an offset of {\bf OffsetDistance} with globally bounded error
  1207.  (controlled by {\bf Epsilon}). The smaller {\bf Epsilon} is, the better
  1208.  the approximation to the offset. The bounded error is achieved by adaptive
  1209.  refinement of the {\bf Crv}.
  1210.    If {\bf TrimLoops} is TRUE or on, the regions of the object that
  1211.  self-intersect as a result of the offset operation are trimmed away.
  1212.  Example:
  1213. @\begin{verbatim}
  1214.     OffCrv1 = AOFFSET( Crv, -0.4, 0.01, TRUE );
  1215.     OffCrv2 = AOFFSET( Crv, -0.4, 0.01, FALSE );
  1216. @\end{verbatim}
  1217.  computes an adaptive offset to {\bf Crv} with {\bf OffsetDistance} of
  1218.  0.5 and {\bf Epsilon} of 0.03 and trims the self-intersection loops.
  1219.  See also OFFSET and LOFFSET.
  1220. @See Figure~\ref{fig-caoffset}.
  1221. @\begin{figure}
  1222. @\vspace{1.6in}
  1223. @\special{psfile=user_man/caoffset.ps hscale=100 vscale=100 hoffset=-60 voffset=-220}
  1224. @\caption{Adaptive offset approximation (thick) of a Bspline curve (thin).
  1225. @        On the left, the self intersections in the offset computed in the
  1226. @        right are eliminated. Both offsets were computedusing AOFFSET.
  1227. @        (See also Figure~\protect\ref{fig-coffset}.)}
  1228. @\label{fig-caoffset}
  1229. @\end{figure}
  1230. @\subsubsection{BOOLONE}
  1231. !BOOLONE
  1232. @\begin{verbatim}
  1233.  SurfaceType BOOLONE( CurveType Crv )
  1234. @\end{verbatim}
  1235.  Given a closed curve, the curve is subdivided into four segments equally
  1236.  spaced in the parametric space that are fed into BOOLSUM. Useful if
  1237.  a surface should "fill" the area enclosed by a closed curve.
  1238.  Example:
  1239. @\begin{verbatim}
  1240.  Srf = BOOLONE( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1241. @\end{verbatim}
  1242.  Creates a disk surface containing the area enclosed by the unit circle.
  1243. @See Figure~\ref{fig-boolsum-one}.
  1244. @\begin{figure}
  1245. @\vspace{3.5in}
  1246. @\special{psfile=user_man/boolone.ps hscale=70 vscale=70 hoffset=-80 voffset=-90}
  1247. @\special{psfile=user_man/boolsum.ps hscale=70 vscale=70 hoffset=170 voffset=-70}
  1248. @\caption{A boolean sum of a circle creates a disk (left) using BOOLONE and
  1249. @        a general boolean sum of four curves (right).}
  1250. @\label{fig-boolsum-one}
  1251. @\end{figure}
  1252. @\subsubsection{BOOLSUM}
  1253. !BOOLSUM
  1254. @\begin{verbatim}
  1255.  SurfaceType BOOLSUM( CurveType Crv1, CurveType Crv2,
  1256.                       CurveType Crv3, CurveType Crv4 )
  1257. @\end{verbatim}
  1258.  Construct a surface using the provided four curves as its four boundary
  1259.  curves. Curves do not have to have the same order or type, and will be
  1260.  promoted to their least common denominator. The end points of the four
  1261.  curves should match as follows:
  1262. # 30 2 0 1
  1263.  {\bf Crv1} start point,
  1264.   to {\bf Crv3} start point.
  1265.  {\bf Crv1} end point,
  1266.   to {\bf Crv4} start point.
  1267.  {\bf Crv2} start point,
  1268.   to {\bf Crv3} end point.
  1269.  {\bf Crv2} end point,
  1270.   to {\bf Crv4} end point.
  1271.  where {\bf Crv1} and {\bf Crv2} are the two boundaries in one parametric
  1272.  direction, and {\bf Crv3} and {\bf Crv4} are the two boundaries in the other
  1273.  parametric direction.
  1274.  Example:
  1275. @\begin{verbatim}
  1276.     Cbzr1 = cbezier( list( ctlpt( E3, 0.1, 0.1, 0.1 ),
  1277.                            ctlpt( E3, 0.0, 0.5, 1.0 ),
  1278.                            ctlpt( E3, 0.4, 1.0, 0.4 ) ) );
  1279.     Cbzr2 = cbezier( list( ctlpt( E3, 1.0, 0.2, 0.2 ),
  1280.                            ctlpt( E3, 1.0, 0.5, -1.0 ),
  1281.                            ctlpt( E3, 1.0, 1.0, 0.3 ) ) );
  1282.     Cbsp3 = cbspline( 4,
  1283.                       list( ctlpt( E3, 0.1,  0.1, 0.1 ),
  1284.                             ctlpt( E3, 0.25, 0.0, -1.0 ),
  1285.                             ctlpt( E3, 0.5,  0.0, 2.0 ),
  1286.                             ctlpt( E3, 0.75, 0.0, -1.0 ),
  1287.                             ctlpt( E3, 1.0,  0.2, 0.2 ) ),
  1288.                       list( KV_OPEN ) );
  1289.     Cbsp4 = cbspline( 4,
  1290.                       list( ctlpt( E3, 0.4,  1.0, 0.4 ),
  1291.                             ctlpt( E3, 0.25, 1.0, 1.0 ),
  1292.                             ctlpt( E3, 0.5,  1.0, -2.0 ),
  1293.                             ctlpt( E3, 0.75, 1.0, 1.0 ),
  1294.                             ctlpt( E3, 1.0,  1.0, 0.3 ) ),
  1295.                       list( KV_OPEN ) );
  1296.     Srf = BOOLSUM( Cbzr1, Cbzr2, Cbsp3, Cbsp4 );
  1297. @\end{verbatim}
  1298. @\subsubsection{BOX}
  1299. @\begin{verbatim}
  1300.  PolygonType BOX( VectorType Point,
  1301.                   NumericType Dx, NumericType Dy, NumericType Dz )
  1302. @\end{verbatim}
  1303.    Creates a BOX polygonal object, whose boundary is coplanar with the
  1304.  $XY$, $XZ$, and $YZ$ planes. The BOX is defined by {\bf Point} as
  1305.  base position, and {\bf Dx, Dy, Dz} as BOX dimensions. Negative dimensions
  1306.  are allowed.
  1307.  Example:
  1308. @\begin{verbatim}
  1309.     B = BOX( vector( 0, 0, 0 ), 1, 1, 1);
  1310. @\end{verbatim}
  1311.  creates a unit cube from 0 to 1 in all axes.
  1312. @\subsubsection{BZR2BSP}
  1313. !BZR2BSP
  1314. @\begin{verbatim}
  1315.  CurveType BZR2BSP( CurveType Crv )
  1316.  SurfaceType BZR2BSP( SurfaceType Srf )
  1317. @\end{verbatim}
  1318.    Creates a Bspline curve or a Bspline surface from the given Bezier curve or
  1319.  Bezier surface. The Bspline curve or surface is assigned open end knot
  1320.  vector(s) with no interior knots, in the parametric domain of zero to one.
  1321.  Example:
  1322. @\begin{verbatim}
  1323.     BspSrf = BZR2BSP( BzrSrf );
  1324. @\end{verbatim}
  1325. @\subsubsection{BSP2BZR}
  1326. !BSP2BZR
  1327. @\begin{verbatim}
  1328.  CurveType | ListType BSP2BZR( CurveType Crv )
  1329.  SurfaceType | ListType BSP2BZR( SurfaceType Srf )
  1330. @\end{verbatim}
  1331.    Creates Bezier curve(s) or surface(s) from a given Bspline curve or a
  1332.  Bspline surface. The Bspline input is subdivided at all internal knots to
  1333.  create Bezier curves or surfaces. Therefore, if the input Bspline does have
  1334.  internal knots, a list of Bezier curves or surfaces is returned. Otherwise,
  1335.  a single Bezier curve or surface is returned.
  1336.  Example:
  1337. @\begin{verbatim}
  1338.     BzrCirc = BSP2BZR( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  1339. @\end{verbatim}
  1340.  would subdivide the unit circle into four 90 degrees Bezier arcs returned
  1341.  in a list.
  1342. @\subsubsection{CBEZIER}
  1343. !CBEZIER
  1344. @\begin{verbatim}
  1345.  CurveType CBEZIER( ListType CtlPtList )
  1346. @\end{verbatim}
  1347.    Creates a Bezier curve out of the provided control point list. {\bf CtlPtList}
  1348.  is a list of control points, all of which must be of type (E1-E5, P1-P5),
  1349.  or regular PointType defining the curve's control polygon. Curve's point type
  1350.  will be of a space which is the union of the spaces of all points.
  1351. @The created curve is the polynomial (or rational),
  1352. @\begin{equation}
  1353. @     C(t) = \sum_{i=0}^k P_i B_i(t),
  1354. @\end{equation}
  1355. @where $P_i$ are the control points {\bf CtlPtList}, and k is the degree of
  1356. @the curve, which is one less than the number of points.
  1357.  Example:
  1358. @\begin{verbatim}
  1359.     s45 = sin(pi / 4);
  1360.     Arc90 = CBEZIER( list( ctlpt( P2, 1.0, 0.0, 1.0 ),
  1361.                            ctlpt( P2, s45, s45, s45 ),
  1362.                            ctlpt( P1, 1.0, 1.0 ) ) );
  1363. @\end{verbatim}
  1364.  constructs an arc of 90 degrees as a rational quadratic Bezier curve.
  1365. @\subsubsection{CBSPLINE}
  1366. !CBSPLINE
  1367. @\begin{verbatim}
  1368.  CurveType CBSPLINE( NumericType Order, ListType CtlPtList,
  1369.                                                         ListType KnotVector )
  1370. @\end{verbatim}
  1371.    Creates a Bspline curve out of the provided control point list, the
  1372.  knot vector, and the specified order. {\bf CtlPtList} is a list of control
  1373.  points, all of which must be of type (E1-E5, P1-P5), or regular PointType
  1374.  defining the curve's control polygon. Curve's point type will be of a space
  1375.  which is the union of the spaces of all points.
  1376.    The length of the {\bf KnotVector} must be equal to the number of control
  1377.  points in {\bf CtlPtList} plus the {\bf Order}. If, however, the length of
  1378.  the knot vector is equal to {\bf \#CtlPtList + Order + Order - 1} the curve
  1379.  is assumed {\em periodic.}
  1380.    The knot vector list may be specified as either {\bf list( KV\_OPEN )} or
  1381.  {\bf list( KV\_FLOAT )} or {\bf list( KV\_PERIODIC )} in which a uniform
  1382.  open, uniform floating or uniform periodic knot vector with the appropriate
  1383.  length is automatically constructed. 
  1384. @The created curve is the piecewise polynomial (or rational),
  1385. @\begin{equation}
  1386. @     C(t) = \sum_{i=0}^k P_i B_{i,\tau}(t),
  1387. @\end{equation}
  1388. @where $P_i$ are the control points {\bf CtlPtList} and k is the degree of
  1389. @the curve, which is one less than the {\bf Order} or number of points.
  1390. @$\tau$ is the knot vector of the curve.
  1391.  Example:
  1392. @\begin{verbatim}
  1393.     s45 = sin(pi / 4);
  1394.     HalfCirc = CBSPLINE( 3,
  1395.                          list( ctlpt( P3,  1.0,  1.0,  0.0, 0.0 ),
  1396.                                ctlpt( P3,  s45,  s45,  s45, 0.0 ),
  1397.                                ctlpt( P3,  1.0,  0.0,  1.0, 0.0 ),
  1398.                                ctlpt( P3,  s45, -s45,  s45, 0.0 ),
  1399.                                ctlpt( P3,  1.0, -1.0,  0.0, 0.0 ) ),
  1400.                          list( 0, 0, 0, 1, 1, 2, 2, 2 ) );
  1401. @\end{verbatim}
  1402.  constructs an arc of 180 degrees in the XZ plane as a rational quadratic
  1403.  Bspline curve.
  1404.  Example:
  1405. @\begin{verbatim}
  1406.     c = CBSPLINE( 4,
  1407.                   list( ctlpt( E2,  0.5,  0.5 ),
  1408.                         ctlpt( E2, -0.5,  0.5 ),
  1409.                         ctlpt( E2, -0.5, -0.5 ),
  1410.                         ctlpt( E2,  0.5, -0.5 ) ),
  1411.                   list( KV_PERIODIC ) );
  1412.     color( c, red );
  1413.     viewobj( c );
  1414.     c1 = cregion( c, 3, 4 );
  1415.     color( c1, green );
  1416.     c2 = cregion( c, 4, 5 );
  1417.     color( c2, yellow );
  1418.     c3 = cregion( c, 5, 6 );
  1419.     color( c3, cyan );
  1420.     c4 = cregion( c, 6, 7 );
  1421.     color( c3, magenta );
  1422.     viewobj( list( c1, c2, c3, c4 ) );
  1423. @\end{verbatim}
  1424.  creates a periodic curve and extracts its four polynomial domains as four
  1425.  {\em open} end Bspline curves.
  1426. @See Figure~\ref{fig-cperiodic}.
  1427. @\begin{figure}
  1428. @\vspace{2.5in}
  1429. @\special{psfile=user_man/cperiod.ps hscale=100 vscale=100 hoffset=-40 voffset=-230}
  1430. @\caption{A cubic periodic curve created using KV\_PERIODIC end conditions.}
  1431. @\label{fig-cperiodic}
  1432. @\end{figure}
  1433. @\subsubsection{CCINTER}
  1434. !CCINTER
  1435. @\begin{verbatim}
  1436.  ListType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1437.                                                        NumericType SelfInter )
  1438.  SurfaceType CCINTER( CurveType Crv1, CurveType Crv2, NumericType Epsilon,
  1439.                                                        NumericType SelfInter )
  1440. @\end{verbatim}
  1441.    Computes the intersection point(s) of {\bf Crv1} and {\bf Crv2} in the
  1442.  $XY$ plane. Since this computation involves numeric operations, {\bf Epsilon}
  1443.  controls the accuracy of the parametric values of the result.
  1444.    It returns a list of PointTypes, each containing the parameter of {\bf Crv1}
  1445.  in the X coordinate, and the parameter of {\bf Crv2} in the Y coordinate.
  1446.    If, however, {\bf Epsilon} is negative, a scalar field surface representing
  1447.  the square of the distance function is returned instead.
  1448.    If {\bf SelfInter} is TRUE, {\bf Crv1} and {\bf Crv2} can be the same
  1449.  curve, and self-intersection points are searched instead.
  1450.  Example:
  1451. @\begin{verbatim}
  1452.  crv1 = cbspline( 3,
  1453.                   list( ctlpt( E2, 0, 0 ),
  1454.                         ctlpt( E2, 0, 0.5 ),
  1455.                         ctlpt( E2, 0.5, 0.7 ),
  1456.                         ctlpt( E2, 1, 1 ) ),
  1457.                   list( KV_OPEN ) );
  1458.  crv2 = cbspline( 3,
  1459.                   list( ctlpt( E2, 1, 0 ),
  1460.                         ctlpt( E2, 0.7, 0.25 ),
  1461.                         ctlpt( E2, 0.3, 0.5 ),
  1462.                         ctlpt( E2, 0, 1 ) ),
  1463.                   list( KV_OPEN ) );
  1464.  inter_pts = CCINTER( crv1, crv2, 0.0001, FALSE );
  1465. @\end{verbatim}
  1466.  Computes the parameter values of the intersection point of {\bf crv1} and
  1467.  {\bf crv2} to a tolerance of 0.0001.
  1468. @See Figure~\ref{fig-cci}.
  1469. @\begin{figure}
  1470. @\vspace{2.5in}
  1471. @\special{psfile=user_man/cci.ps hscale=100 vscale=100 hoffset=-60 voffset=-200}
  1472. @\caption{A intersection point of two freeform curve computed using CCINTER.}
  1473. @\label{fig-cci}
  1474. @\end{figure}
  1475. @\subsubsection{CCRVTR}
  1476. !CCRVTR
  1477. @\begin{verbatim}
  1478.  NumericType CCRVTR( CurveType Crv, NumericType Epsilon )
  1479.  CurveType CCRVTR( CurveType Crv, NumericType Epsilon )
  1480. @\end{verbatim}
  1481.    Computes the extreme curvature points on {\bf Crv} in the $XY$ plane.
  1482.  This set includes not only points of maximum (convexity) and mimumum
  1483.  (concavity) curvature, but also points of zero curvature such as
  1484.  inflection points.
  1485.    Since this operation is partially numeric, {\bf Epsilon} is used to set
  1486.  the needed accuracy. It returns the parameter value(s) of the location(s)
  1487.  with extreme curvature along the {\bf Crv}.
  1488.    If, however, {\bf Epsilon} is negative, the curvature scalar field
  1489.  curve is returned as a two dimensional rational vector field curve, for
  1490.  which the first dimension is equal to the parameter, and the second is the
  1491.  curvature value at that parameter.
  1492. @   This function computes the curvature scalar field for planar curves as,
  1493. @\begin{equation}
  1494. @      \kappa(t) = \frac{x'(t) y''(t) - x''(t) y'(t)}
  1495. @             {\left( (x'(t))^2 + (y'(t))^2\ \right)^{\frac{3}{2}}},
  1496. @\end{equation}
  1497. @ and computes kN for three dimensional curves as the following vector field,
  1498. @\begin{equation}
  1499. @      \kappa(t) N(t) = \kappa(t) B(t) \times T(t) =
  1500. @       \frac{C' \times C''}{\| C' \| ^ 3} \times \frac{C'}{\| C' \|} =
  1501. @       \frac{(C' \times C'') \times C'}{\| C' \| ^ 4}.
  1502. @\end{equation}
  1503. ^   This function computes the curvature scalar field for planar curves as,
  1504. ^          x' y'' - x'' y' 
  1505. ^   k(t) = ----------------
  1506. ^               2     2  3/2
  1507. ^           ( x'  + y'  )
  1508. ^ and computes kN for three dimensional curves as the following vector field,
  1509. ^                                  C' x C''     C'    (C' x C'') x C'
  1510. ^   k(t) N(t) = K(t) B(t) x T(t) = -------- x ----- = ---------------
  1511. ^                                        3    | C' |            4
  1512. ^                                   | C'|                 | C' |
  1513.  The extremum values are extracted from the computed curvature field.
  1514.  This curvature field is a high order curve, even if the input geometry is
  1515.  of low order. This is especially true for rational curves, for which the
  1516.  quotient rule for differentiation is used and almost doubles the degree
  1517.  in every differentiation.
  1518.  See also CZEROS, CEXTREMES, and SCRVTR.
  1519.  Example:
  1520. @\begin{verbatim}
  1521.  crv = cbezier( list( ctlpt( E2, -1.0,  0.5 ),
  1522.                       ctlpt( E2, -0.5, -2.0 ),
  1523.                       ctlpt( E2,  0.0,  1.0 ),
  1524.                       ctlpt( E2,  1.0,  0.0 ) ) ) * rotz( 30 );
  1525.  crvtr = CCRVTR( crv, 0.001 );
  1526.  pt_crvtr = nil();
  1527.  pt = nil();
  1528.  for ( i = 1, 1, sizeof( crvtr ),
  1529.      ( pt = ceval( crv, nth( crvtr, i ) ) ):
  1530.      snoc( pt, pt_crvtr )
  1531.  interact( list( crv, pt_crvtr ) );
  1532. @\end{verbatim}
  1533.  finds the extreme curvature points in {\bf Crv} and displays them all
  1534.  with the curve.
  1535. @See Figure~\ref{fig-ccrvtr}.
  1536. @\begin{figure}
  1537. @\vspace{2.3in}
  1538. @\special{psfile=user_man/ccrvtr.ps hscale=100 vscale=100 hoffset=-40 voffset=-220}
  1539. @\caption{Extreme curvature locations on a freeform curve computed using CCRVTR.}
  1540. @\label{fig-ccrvtr}
  1541. @\end{figure}
  1542. @\subsubsection{CDERIVE}
  1543. !CDERIVE
  1544. @\begin{verbatim}
  1545.  CurveType CDERIVE( CurveType Curve )
  1546. @\end{verbatim}
  1547.    Returns a vector field curve representing the differentiated curve,
  1548.  also known as the Hodograph curve.
  1549.  Example:
  1550. @\begin{verbatim}
  1551.  Circ = circle( vector( 0.0, 0.0, 0.0 ), 1.0 );
  1552.  Hodograph = CDERIVE( Circ );
  1553. @\end{verbatim}
  1554. @See Figure~\ref{fig-cderive}.
  1555. @\begin{figure}
  1556. @\vspace{3.5in}
  1557. @\special{psfile=user_man/cderive.ps hscale=100 vscale=100 hoffset=-40 voffset=-210}
  1558. @\caption{The hodograph (thick) of a bspline circle (thin) constructed as four
  1559. @        90 degrees rational bezier arcs, computed using CDERIVE.}
  1560. @\label{fig-cderive}
  1561. @\end{figure}
  1562. @\subsubsection{CDIVIDE}
  1563. !CDIVIDE
  1564. @\begin{verbatim}
  1565.  ListType CDIVIDE( CurveType Curve, NumericType Param )
  1566. @\end{verbatim}
  1567.    Subdivides a curve into two sub-curves at the specified parameter value.
  1568.  {\bf Curve} can be either a Bspline curve in which {\bf Param} must be
  1569.  within the Curve's parametric domain, or a Bezier curve in which {\bf Param}
  1570.  must be in the range of zero to one.
  1571.    It returns a list of the two sub-curves. The individual curves may be
  1572.  extracted from the list using the NTH command.
  1573.  Example:
  1574. @\begin{verbatim}
  1575.  CrvLst = CDIVIDE( Crv, 1.3 );
  1576.  Crv1 = nth( CrvLst, 1 );
  1577.  Crv2 = nth( CrvLst, 2 );
  1578. @\end{verbatim}
  1579.  subdivides the curve {\bf Crv} at the parameter value of 0.5.
  1580. @See Figure~\ref{fig-cdivide}.
  1581. @\begin{figure}
  1582. @\vspace{2.7in}
  1583. @\special{psfile=user_man/cdivide.ps hscale=80 vscale=80 hoffset=30 voffset=-140}
  1584. @\caption{A Bspline curve is subdivided into two distinct regions using CDIVIDE.}
  1585. @\label{fig-cdivide}
  1586. @\end{figure}
  1587. @\subsubsection{CEDITPT}
  1588. !CEDITPT
  1589. @\begin{verbatim}
  1590.  CurveType CEDITPT( CurveType Curve, CtlPtType CtlPt, NumericType Index )
  1591. @\end{verbatim}
  1592.    Provides a simple mechanism to manually modify a single control point number
  1593.  {\bf Index} (base count is 0) in {\bf Curve}, by substituting {\bf CtlPt}
  1594.  instead. {\bf CtlPt} must have the same point type as the control points of
  1595.  the  {\bf Curve}. Original curve {\bf Curve} is not modified.
  1596.  Example:
  1597. @\begin{verbatim}
  1598.     CPt = ctlpt( E3, 1, 2, 3 );
  1599.     NewCrv = CEDITPT( Curve, CPt, 1 );
  1600. @\end{verbatim}
  1601.  constructs a {\bf NewCrv} with the second control point of {\bf Curve} being
  1602.  {\bf CPt}.
  1603. @\subsubsection{CEVAL}
  1604. !CEVAL
  1605. @\begin{verbatim}
  1606.  CtlPtType CEVAL( CurveType Curve, NumericType Param )
  1607. @\end{verbatim}
  1608.    Evaluates the provided {\bf Curve} at the given {\bf Param} value.
  1609.  {\bf Param} should be in the curve's parametric domain if {\bf Curve} is
  1610.  a Bspline curve, or between zero and one if {\bf Curve} is a Bezier curve.
  1611.  The returned control point has the same point type as the control points
  1612.  of the {\bf Curve}.
  1613.  Example:
  1614. @\begin{verbatim}
  1615.     CPt = CEVAL( Crv, 0.25 );
  1616. @\end{verbatim}
  1617.  evaluates {\bf Crv} at the parameter value of 0.25.
  1618. @\subsubsection{CEVOLUTE}
  1619. !CEVOLUTE
  1620. @\begin{verbatim}
  1621.  CurveType CEVOLUTE( CurveType Curve )
  1622. @\end{verbatim}
  1623.    Computes the evolute of a curve. The evolute is defined as,
  1624. @\begin{equation}
  1625. @  E(t) = C(t) + \frac{N(t)}{\kappa(t)},
  1626. @\end{equation}
  1627. @ where $N(t)$ is the unit normal of $C(t)$ and $k(t)$ is its curvature.
  1628. @  $E(t)$ is computed symbolically as the symbolic sum of $C(t)$ and
  1629. @ $\frac{N(t)}{\kappa(t)}$ where the latter is,
  1630. @\begin{eqnarray}
  1631. @  \frac{N(t)}{\kappa(t)}
  1632. @ & = & \frac{\kappa(t) N(t)}{k^2(t)} \nonumber \\
  1633. @ & = & \frac{(C'(t) \times C''(t)) \times C'(t)}
  1634. @             {\| C'(t) \|^4}
  1635. @       \frac{\|C'(t)\|^6}
  1636. @            {(C'(t) \times C''(t))^2}  \nonumber \\
  1637. @ & = & \frac{\left( {(C'(t) \times C''(t)) \times C'(t)} \right)
  1638. @                                        \| C'(t) \|^2}
  1639. @             {(C'(t) \times C''(t))^2}
  1640. @\end{eqnarray}
  1641. ^               N(t)
  1642. ^ E(t) = C(t) + ----
  1643. ^               k(t)
  1644. ^ where N(t) is the unit normal of C(t) and k(t) is its curvature.
  1645. ^ E(t) is computed symbolically as the symbolic sum of C(t) and
  1646. ^ N(t) / k(t).
  1647.  The result of this symbolic computation is exact (upto machine precision)
  1648.  unlike a similar operation which is only approximated, the OFFSET or the
  1649.  AOFFSET.
  1650.  Example:
  1651. @\begin{verbatim}
  1652.     crv = cbspline( 3,
  1653.                     list( ctlpt( E3, -1.0,  0.1,  0.2 ),
  1654.                           ctlpt( E3, -0.1,  1.0,  0.1 ),
  1655.                           ctlpt( E3,  0.1,  0.1,  1.0 ),
  1656.                           ctlpt( E3,  1.0,  0.1,  0.1 ),
  1657.                           ctlpt( E3,  0.1,  1.0,  0.2 ) ),
  1658.                     list( KV_OPEN ) );
  1659.     cev = CEVOLUTE( Crv );
  1660. @\end{verbatim}
  1661. @See Figure~\ref{fig-cevolute}.
  1662. @\begin{figure}
  1663. @\vspace{2in}
  1664. @\special{psfile=user_man/cevolute.ps hscale=100 vscale=100 hoffset=-20 voffset=-260}
  1665. @\caption{The evolute (thick) of a freeform curve (thin) can be computed using
  1666. @        CEVOLUTE.}
  1667. @\label{fig-cevolute}
  1668. @\end{figure}
  1669. @\subsubsection{CEXTREMES}
  1670. !CEXTREMES
  1671. @\begin{verbatim}
  1672.  ListType CEXTREMES( CurveType Crv, NumericType Epsilon, NumericType Axis )
  1673. @\end{verbatim}
  1674.    Computes the extreme set of the given {\bf Crv} in the given axis (1 for X,
  1675.  2 for Y, 3 for Z). Since this computation is numeric, an {\bf Epsilon} is
  1676.  also required to specify the desired tolerance. It returns a list of
  1677.  all the parameter values (NumericType) in which the curve takes an extreme
  1678.  value.
  1679.  Example:
  1680. @\begin{verbatim}
  1681.     extremes = CEXTREMES( Crv, 0.0001, 1 );
  1682. @\end{verbatim}
  1683.  Computes the extreme set of curve {\bf crv}, in the {\bf X} axis, with
  1684.  error tolerance of {\bf 0.0001}. See also CZERO.
  1685. @See Figure~\ref{fig-cextreme}.
  1686. @\begin{figure}
  1687. @\vspace{2in}
  1688. @\special{psfile=user_man/cextreme.ps hscale=100 vscale=100 hoffset=-40 voffset=-330}
  1689. @\caption{The X local extremums of a freeform curve are isolated using CEXTREMES.}
  1690. @\label{fig-cextreme}
  1691. @\end{figure}
  1692. @\subsubsection{CINFLECT}
  1693. !CINFLECT
  1694. @\begin{verbatim}
  1695.  ListType CINFLECT( CurveType Crv, NumericType Epsilon )
  1696.  CurveType CINFLECT( CurveType Crv, NumericType Epsilon )
  1697. @\end{verbatim}
  1698.    Computes the inflection points of {\bf Crv} in the $XY$ plane.
  1699.  Since this computation is numeric, an {\bf Epsilon} is also required
  1700.  to specify the desired tolerance. It returns a list of all the
  1701.  parameter values (NumericType) in which the curve has an inflection point.
  1702.    If, however, {\bf Epsilon} is negative, a scalar field curve representing
  1703.  the sign of the curvature of the curve is returned instead.
  1704. @ The sign of curvature scalar field is equal to,
  1705. @\begin{equation}
  1706. @      \sigma(t) = x'(t) y''(t) - x''(t) y'(t).
  1707. @\end{equation}
  1708. ^ The sign of curvature scalar field is equal to
  1709. ^       s(t) = x' y'' - x'' y' 
  1710.  Example:
  1711. @\begin{verbatim}
  1712.     inflect = CINFLECT( crv, 0.001 );
  1713.     pt_inflect = nil();
  1714.     pt = nil();
  1715.     for ( i = 1, 1, sizeof( inflect ),
  1716.             pt = ceval( crv, nth( inflect, i ) ):
  1717.             snoc( pt, pt_inflect )
  1718.         );
  1719.     interact( list( axes, crv, pt_inflect ), 0);
  1720. @\end{verbatim}
  1721.  Computes the set of inflection points of curve {\bf crv} with error
  1722.  tolerance of {\bf 0.001}. This set is then scanned in a loop and
  1723.  evaluated to the curve's locations which are then displayed with the {\bf crv}.
  1724.  See also CZEROS, CEXTREMES, and CCRVTR.
  1725. @See Figure~\ref{fig-cinflect}.
  1726. @\begin{figure}
  1727. @\vspace{1.2in}
  1728. @\special{psfile=user_man/cinflect.ps hscale=100 vscale=100 hoffset=-40 voffset=-310}
  1729. @\caption{The Inflection points of a freeform curve can be isolated using CINFLECT.}
  1730. @\label{fig-cinflect}
  1731. @\end{figure}
  1732. @\subsubsection{CINTERP}
  1733. !CINTERP
  1734. @\begin{verbatim}
  1735.  CurveType CINTERP( ListType PtList, NumericType Order, NumericType Size,
  1736.                                                         ConstantType Param)
  1737. @\end{verbatim}
  1738.    Computes a Bspline polynomial curve that interpolates or approximates
  1739.  the list of points in {\bf PtList}. The Bspline curve will have order
  1740.  {\bf Order} and {\bf Size} control points. The knots will be spaced
  1741.  according to {\bf Param} which can be one of PARAM\_UNIFORM,
  1742.  PARAM\_CHORD or PARAM\_CENTRIP. The former prescribes a uniform knot
  1743.  sequence and the latters specify knot spacing according to the chord
  1744.  length and a square root of the chord length.
  1745.    All points in {\bf PtList} must be of type (E1-E5, P1-P5) control point,
  1746.  or regular PointType. If {\bf Size} is equal to the number of points in
  1747.  {\bf PtList} the resulting curve will {\em interpolate} the data set.
  1748.  Otherwise, if {\bf Size} is less than the number of points in {\bf PtList}
  1749.  the point data set will be least square approximated. In no time can {\bf Size}
  1750.  be larger that the number of points in {\bf PtList} or lower than {\bf Order}.
  1751.  {\bf Size} of zero forces interpolation by setting {\bf Size} to the
  1752.  data set size.
  1753.    All interior knots will be distinct preserving maximal continuity.
  1754.  The resulting Bspline curve will have open end conditions.
  1755.  Example:
  1756. @\begin{verbatim}
  1757.     pl = nil();
  1758.     for ( x = 0, 1, 100,
  1759.           snoc(point(cos(x / 5), sin(x / 5), x / 50 - 1), pl)
  1760.     );
  1761.     c = CINTERP( pl, 3, 21, PARAM_UNIFORM );
  1762. @\end{verbatim}
  1763.  Samples a helical curve at 100 points and least square fit a quadratic
  1764.  Bspline curve with 21 point to the data set. The curve will have a uniform
  1765.  knot spacing.
  1766. @See Figure~\ref{fig-cinterp}.
  1767. @\begin{figure}
  1768. @\vspace{2.6in}
  1769. @\special{psfile=user_man/cinterp.ps hscale=100 vscale=100 hoffset=-40 voffset=-150}
  1770. @\caption{A Helix is sampled at 100 locations is least square fit using CINTERP
  1771. @        by a quadratic Bspline curve and 21 control points.}
  1772. @\label{fig-cinterp}
  1773. @\end{figure}
  1774. @\subsubsection{CIRCLE}
  1775. !CIRCLE
  1776. @\begin{verbatim}
  1777.  CurveType CIRCLE( VectorType Center, NumericType Radius )
  1778. @\end{verbatim}
  1779.    Constructs a circle at the specified {\bf Center} with the specified
  1780.  {\bf Radius}. The returned circle is a Bspline curve of four piecewise Bezier
  1781.  90 degree arcs. The construced circle is always parallel to the $XY$ plane.
  1782.  Use the linear transformation routines to place the circle in the appropriate
  1783.  orientation and location.
  1784. @\subsubsection{CIRCPOLY}
  1785. !CIRCPOLY
  1786. @\begin{verbatim}
  1787.  PolygonType CIRCPOLY( VectorType Normal, VectorType Trans, NumericType Radius )
  1788. @\end{verbatim}
  1789.    Defines a circular polygon in a plane perpendicular to {\bf Normal} that
  1790.  contains the {\bf Trans} point. Constructed polygon is centered at
  1791.  {\bf Trans}. RESOLUTION vertices will be defined with {\bf Radius} from
  1792.  distance from {\bf Trans}.
  1793.    Alternative ways to construct a polygon are manual construction of the
  1794.  vertices using POLY, or the construction of a flat ruled surface using
  1795.  RULEDSRF.
  1796. @\subsubsection{CLNTREAD}
  1797. !CLNTREAD
  1798. @\begin{verbatim}
  1799.  AnyType CLNTREAD( NumericType Handler, NumericType Block )
  1800. @\end{verbatim}
  1801.    Reads one object from a communication channel of a client.
  1802.  {\bf Handler} contains the index of the communication channel opened via
  1803.  CLNTEXEC. If no data is available in the communication channel, this
  1804.  function will block for at most {\bf Block} millisecond until data is found
  1805.  or timeout occurs. In the latter, a single StringType object is returned
  1806.  with the content of "no data (timeout)".  See also CLNTWRITE, CLNTCLOSE,
  1807.  and CLNTEXEC.
  1808.  Example:
  1809. @\begin{verbatim}
  1810.    h2 = clntexec( "xmtdrvs -s-" );
  1811.        .
  1812.        .
  1813.    Model = CLNTREAD( h2 );
  1814.        .
  1815.        .
  1816.    clntclose( h2,TRUE );
  1817. @\end{verbatim}
  1818.  reads one object from client through communication channel h2 and save it
  1819.  in variable Model.
  1820. @\subsubsection{CMORPH}
  1821. !CMORPH
  1822. @\begin{verbatim}
  1823.  CurveType CMORPH( CurveType Crv1, CurveType Crv2,
  1824.                    NumericType Method, NumericType Blend )
  1825.  ListType CMORPH( CurveType Crv1, CurveType Crv2,
  1826.                   NumericType Method, NumericType Blend )
  1827. @\end{verbatim}
  1828.  Creates a new curve which is a {\em metamorph} of the two given curves.
  1829.  The two given curves must be compatible (see FFCOMPAT) before this blend
  1830.  is invoked. Very useful if a sequence that "morphs" one curve to another
  1831.  is to be created. Several methods of metamorphosis are supported according
  1832.  to the value of {\bf Method},
  1833. # 3 2 0 1
  1834.   Simple convex blend.
  1835.   Corner/Edge cutting scheme, scaled to same curve length.
  1836.   Corner/Edge cutting scheme, scaled to same bounding box.
  1837.   Same as 1 but with filtering out of tangencies.
  1838.   Same as 2 but with filtering out of tangencies.
  1839.   Multiresolution decompsition based metamorphosis. See CMULTRES.
  1840.    In {\bf Method} 1, {\bf Blend} is a number between zero ({\bf Crv1})
  1841.  and one ({\bf Crv2}) defining the similarity to {\bf Crv1} and {\bf Crv2},
  1842.  respectively. A single curve is returned.
  1843.    In {\bf Method}s 2 to 5, {\bf Blend} is a step size for the
  1844.  metamorphosis operation and a whole list describing the entire
  1845.  metamorphosis operation is returned.
  1846.  Examples:
  1847. @\begin{verbatim}
  1848.  crv1 = cbezier( list( ctlpt( E2,  0.3,  0.0 ),
  1849.                        ctlpt( E2,  0.0,  0.5 ),
  1850.                        ctlpt( E2, -0.2,  0.0 ) ) );
  1851.  crv1a = crv1 * trans( vector( -0.4, 0.0, 0.0 ) );
  1852.  crv1b = crv1a * scale( vector( -1.0, 1.0, 1.0 ) );
  1853.  for ( i = 0, 1, 300,
  1854.      c = cmorph( crv1a, crv1b, 0, i / 300.0 ):
  1855.      color( c, yellow ):
  1856.      viewobj( c )
  1857.  crvs = cmorph( crv1a, crv1b, 2, 0.003 );
  1858.  snoc( crv1b, crvs );
  1859.  for ( i = 1, 1, sizeof( crvs ),
  1860.      c = nth( crvs, i ):
  1861.      color( c, yellow ):
  1862.      viewobj( c )
  1863. @\end{verbatim}
  1864.  creates two metamorphosis animation sequences, one that is based on
  1865.  a convex blend and one that is based on corner/edge cutting scheme.
  1866.  See alost SMORPH.
  1867. @See Figure~\ref{fig-cmorph}.
  1868. @\begin{figure}
  1869. @\begin{picture}(0,200)
  1870. @    \put(110,  0){\large (a)}
  1871. @    \put(320,  0){\large (b)}
  1872. @\end{picture}
  1873. @\special{psfile=user_man/cmorph.ps hscale=100 vscale=100 hoffset=-50 voffset=-260}
  1874. @\caption{A morphing sequence using convex blend (a) and edge cutting (b).}
  1875. @\label{fig-cmorph}
  1876. @\end{figure}
  1877. @\subsubsection{CMULTIRES}
  1878. !CMULTIRES
  1879. @\begin{verbatim}
  1880.  ListType CMULTIRES( CurveType Crv, NumericType Discont )
  1881. @\end{verbatim}
  1882.    Computes a multiresolution decomposition of curve {\bf Crv} using least
  1883.  squares approximation. The resulting list of curves describes an hierarchy
  1884.  of curves in linear subspaces of the space {\bf Crv} was in that can be
  1885.  sum algebraically to form {\bf Crv}. Each of the curves in the hierarchy
  1886.  is a least squares approximation of {\bf Crv} in the subspace it is defined
  1887.  in. {\bf Discont} is a boolean flat that controls the way tangent
  1888.  discontinuities are computed throughout the decomposition.
  1889.  Example:
  1890. @\begin{verbatim}
  1891.     MRCrv = CMULTIRES( Animal, false );
  1892.     sum = nth( MRCrv, 1 );
  1893.     MRCrvs = list( sum * tx( 3.0 ) );
  1894.     for ( ( i = 2 ), 1, sizeof( MRCrv ),
  1895.         sum = symbsum( sum, nth( MRCrv, i ) ):
  1896.         snoc( sum * tx( ( 3 - i ) * 1.5 ), MRCrvs )
  1897.     );
  1898.     All = MRCrvs * sc ( 0.25 );
  1899.     view( All, on );
  1900. @\end{verbatim}
  1901.  Computes a multiresolution decomposition to curve {\bf CrossSec} as
  1902.  {\bf MRCrv} and display all the decomposition levels by summing them all
  1903.  up. The use of {\bf none} as on object name allows one to display an
  1904.  object in the display device without replacing the previous object in the
  1905.  display device, carrying the same name.
  1906.  creates two metamorphosis animation sequences, one that is based on
  1907.  a convex blend and one that is based on corner/edge cutting scheme.
  1908. @See Figure~\ref{fig-cmultres}.
  1909. @\begin{figure}
  1910. @\vspace{1.2in}
  1911. @\special{psfile=user_man/cmultres.ps hscale=100 vscale=100 hoffset=-50 voffset=-280}
  1912. @\caption{A multiresolution decomposition of a curve of an animal using
  1913. @         list squares. Original curve is shown on the left.}
  1914. @\label{fig-cmultres}
  1915. @\end{figure}
  1916. @\subsubsection{CMESH}
  1917. !CMESH
  1918. @\begin{verbatim}
  1919.  CurveType CMESH( SurfaceType Srf, ConstantType Direction, NumericType Index )
  1920. @\end{verbatim}
  1921.    Returns a single ROW or COLumn as specified by the {\bf Direction} and
  1922.  {\bf Index} (base count is 0) of the control mesh of surface {\bf Srf}.
  1923.    The returned curve will have the same knot vector as {\bf Srf} in the
  1924.  appropriate direction. See also CSURFACE.
  1925.    This curve is {\em not} necessarily in the surface {\bf Srf}.
  1926. @It is equal to,
  1927. @\begin{equation}
  1928. @     C(t) = \sum_{i=0}^m P_{ij} B_i(t),
  1929. @\end{equation}
  1930. @and similar for the other parametric direction.
  1931.  Example:
  1932. @\begin{verbatim}
  1933.     Crv = CMESH( Srf, COL, 0 );
  1934. @\end{verbatim}
  1935.  extracts the first column of surface {\bf Srf} as a curve. See also
  1936.  CSURFACE.
  1937. @\subsubsection{COERCE}
  1938. !COERCE
  1939. @\begin{verbatim}
  1940.  AnyType COERCE( AnyType Object, ConstantType NewType )
  1941. @\end{verbatim}
  1942.    Provides a coercion mechanism between different objects or object types.
  1943.  PointType, VectorType, PlaneType, CtlPtType can be all coerced to each
  1944.  other by using the {\bf NewType} of POINT\_TYPE, VECTOR\_TYPE, PLANE\_TYPE,
  1945.  or one of E1-E5, P1-P5 (CtlPtType). Similarly, CurveType, SurfaceType,
  1946.  TrimSrfType, and TrivarType can all be coerced to hold different
  1947.  CtlPtType of control points, or even different open end conditions from
  1948.  KV\_PERIODIC to KV\_FLOAT to KV\_OPEN.
  1949.    If a scalar (E1 or P1) curve is coerced to E2 or P2 curve or
  1950.  a scalar (E1 or P1) surface is coerced to E3 or P3 surface, the Y (YZ)
  1951.  coordinate(s) is (are) updated to hold the parametric domain of the curve
  1952.  (surface).
  1953.  Example:
  1954. @\begin{verbatim}
  1955.     CrvE2 = COERCE( Crv, E2 );
  1956. @\end{verbatim}
  1957.  coerce {\bf Crv} to a new curve that will have an E2 CtlPtType control
  1958.  points. Coerction of a projective curve (P1-P5) to a Euclidean curve
  1959.  (E1-E5) does not preseve the shape of the curve.
  1960. @\subsubsection{COMPOSE}
  1961. !COMPOSE
  1962. @\begin{verbatim}
  1963.  CurveType COMPOSE( CurveType Crv1, CurveType Crv2 )
  1964.  CurveType COMPOSE( SurfaceType Srf, CurveType Crv )
  1965. @\end{verbatim}
  1966.    Symbolically compute the composition curve {\bf Crv1(Crv2(t))} or
  1967.  {\bf Srf(Crv(t))}. In {\bf Crv1(Crv2(t)}, {\bf Crv1} can be any curve
  1968.  while {\bf Crv2} must be a one-dimensional curve that is either E1 or
  1969.  P1. In {\bf Srf(Crv(t))}, {\bf Srf} can be any surface, while {\bf Crv}
  1970.  must be a two-dimensional curve, that is either E2 or P2. Both {\bf Crv2}
  1971.  in the curve's composition, and {\bf Crv} is the surface's composition
  1972.  must be contained in the curve or surface parametric domain.
  1973.  Example:
  1974. @\begin{verbatim}
  1975.    srf = sbezier( list( list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  1976.                               ctlpt( E3, 0.0, 0.5, 1.0 ),
  1977.                               ctlpt( E3, 0.0, 1.0, 0.0 ) ),
  1978.                         list( ctlpt( E3, 0.5, 0.0, 1.0 ),
  1979.                               ctlpt( E3, 0.5, 0.5, 0.0 ),
  1980.                               ctlpt( E3, 0.5, 1.0, 1.0 ) ),
  1981.                         list( ctlpt( E3, 1.0, 0.0, 1.0 ),
  1982.                               ctlpt( E3, 1.0, 0.5, 0.0 ),
  1983.                               ctlpt( E3, 1.0, 1.0, 1.0 ) ) ) );
  1984.    crv = coerce( circle( vector( 0.0, 0.0, 1.0 ), 0.4 ), p2 ) *
  1985.          trans( vector( 0.5, 0.5, 0.0 ) );
  1986.    comp_crv = COMPOSE( srf, crv );
  1987. @\end{verbatim}
  1988.  compose a circle {\bf Crv} to be on the surface {\bf Srf}.
  1989. @See Figure~\ref{fig-compose}.
  1990. @\begin{figure}
  1991. @\vspace{2.5in}
  1992. @\special{psfile=user_man/compose.ps hscale=100 vscale=100 hoffset=-10 voffset=-210}
  1993. @\caption{A circle in the parametric space of the freefrom surface is composed
  1994. @        to create a closed loop curve on the surface using COMPOSE.}
  1995. @\label{fig-compose}
  1996. @\end{figure}
  1997. @\subsubsection{CON2}
  1998. !CON2
  1999. @\begin{verbatim}
  2000.  PolygonType CON2( VectorType Center, VectorType Direction,
  2001.                    NumericType Radius1, NumericType Radius2 )
  2002. @\end{verbatim}
  2003.    Creates a truncated CONE geometric object, defined by {\bf Center} as the
  2004.  center of the main base of the CONE, {\bf Direction} as both the CONE's axis
  2005.  and the length of CONE, and the two radii {\bf Radius1/2} of the two bases of
  2006.  the CONE.
  2007.    Unlike the regular cone (CONE) constructor which has inherited
  2008.  discontinuities in its generated normals at the apex, CON2 can be used to
  2009.  form a (truncated) cone with continuous normals. 
  2010.    See RESOLUTION for the accuracy of the CON2 approximation as a polygonal
  2011.  model.
  2012.  Example:
  2013. @\begin{verbatim}
  2014.     Cone2 = CON2( vector( 0, 0, -1 ), vector( 0, 0, 4 ), 2, 1 );
  2015. @\end{verbatim}
  2016.  constructs a truncated cone with bases parallel to the $XY$ plane at
  2017.  $Z = -1$ and $Z = 3$, and with radii of 2 and 1 respectively.
  2018. @See Figure~\ref{fig-cones}.
  2019. @\begin{figure}
  2020. @\vspace{2.7in}
  2021. @\special{psfile=user_man/cones.ps hscale=100 vscale=100 hoffset=0 voffset=-220}
  2022. @\caption{A cone (left) can be constructed using the CONE constructor and
  2023. @         a truncated cone (right) using the constructor CONE2.}
  2024. @\label{fig-cones}
  2025. @\end{figure}
  2026. @\subsubsection{CONE}
  2027. !CONE
  2028. @\begin{verbatim}
  2029.  PolygonType CONE( VectorType Center, VectorType Direction,
  2030.                    NumericType Radius )
  2031. @\end{verbatim}
  2032.    Creates a CONE geometric object, defined by {\bf Center} as the center of
  2033.  the base of the CONE, {\bf Direction} as the CONE's axis and height, and
  2034.  {\bf Radius} as the radius of the base of the CONE.
  2035.    See RESOLUTION for accuracy of the CONE approximation as a polygonal model. 
  2036.  Example:
  2037. @\begin{verbatim}
  2038.     Cone1 = CONE( vector( 0, 0, 0 ), vector( 1, 1, 1 ), 1 );
  2039. @\end{verbatim}
  2040.  constructs a cone based in an $XY$ parallel plane, centered at the origin
  2041.  with radius 1 and with tilted apex at ( 1, 1, 1 ).
  2042.    See also CON2.
  2043. @See Figure~\ref{fig-cones}.
  2044. @\subsubsection{CONVEX}
  2045. !CONVEX
  2046. @\begin{verbatim}
  2047.  PolygonType CONVEX( PolygonType Object )
  2048.  ListType CONVEX( ListType Object )
  2049. @\end{verbatim}
  2050.    Converts non-convex polygons in {\bf Object}, into convex ones. New vertices
  2051.  are introduced into the polygonal data during this process. The Boolean
  2052.  operations require the input to have convex polygons only (although it may
  2053.  return non convex polygons...) and it automatically converts non-convex input
  2054.  polygons to convex ones, using this same routine.
  2055.    However, some external tools (like irit2ray and poly3d-h) require convex
  2056.  polygons. This function must be used on the objects to guarantee that
  2057.  only convex polygons are saved into data files for these external tools.
  2058. @\begin{verbatim}
  2059.     CnvxObj = CONVEX( Obj );
  2060.     save( "data", CnvxObj );
  2061. @\end{verbatim}
  2062.  converts non-convex polygons into convex ones, so that the data file can be
  2063.  used by external tools requiring convex polygons.
  2064. @\subsubsection{COORD}
  2065. !COORD
  2066. @\begin{verbatim}
  2067.  AnyType COORD( AnyType Object, NumericType Index )
  2068. @\end{verbatim}
  2069.    Extracts an element from a given {\bf Object}, at index {\bf Index}. From
  2070.  a PointType, VectorType, PlaneType, CtlPtType and MatrixType, a NumericType
  2071.  is returned with {\bf Index} 0 for the X axis, 1 for the Y axis etc.
  2072.  {\bf Index} 0 denotes the weight of CtlPtType. For a PolygonType that
  2073.  contains more than one polygon, the {\bf Index}th polygon is returned. For
  2074.  a PolygonType that contains a single Polygon, the {\bf Index}th vertex is
  2075.  returned. For a CurveType or a SurfaceType, the {\bf Index}th CtlPtType is
  2076.  returned. For a ListType, COORD behaves like NTH and returns the {\bf Index}th
  2077.  object in the list.
  2078.  Example:
  2079. @\begin{verbatim}
  2080.     a = vector( 1, 2, 3 );
  2081.     vector( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ) );
  2082.     a = ctlpt( P2, 6, 7, 8, 9 );
  2083.     ctlpt( P3, coord( a, 0 ), coord( a, 1 ), coord( a, 2 ), coord( a, 3 ) );
  2084.     a = plane( 10, 11, 12, 13 );
  2085.     plane( COORD( a, 0 ), COORD( a, 1 ), COORD( a, 2 ), COORD( a, 3 ) );
  2086. @\end{verbatim}
  2087.  constructs a vector/ctlpt/plane and reconstructs it by extracting the
  2088.  constructed scalar components of the objects using COORD.
  2089.    See also COERCE.
  2090. @\subsubsection{CRAISE}
  2091. !CRAISE
  2092. @\begin{verbatim}
  2093.  CurveType CRAISE( CurveType Curve, NumericType NewOrder )
  2094. @\end{verbatim}
  2095.    Raise {\bf Curve} to the {\bf NewOrder} Order specified.
  2096.  Example:
  2097. @\begin{verbatim}
  2098.     Crv = cbezier( list( ctlpt( E2, -0.7,  0.3 ),
  2099.                          ctlpt( E2,  0.0,  1.0 ),
  2100.                          ctlpt( E2,  0.7,  0.0 ) ) );
  2101.     Crv2 = CRAISE( Crv, 5 );
  2102. @\end{verbatim}
  2103.  raises the 90 degrees corner Bezier curve {\bf Crv} to be a quartic.
  2104. @See Figure~\ref{fig-craise}.
  2105. @\begin{figure}
  2106. @\vspace{2.5in}
  2107. @\special{psfile=user_man/craise.ps hscale=70 vscale=70 hoffset=30 voffset=-220}
  2108. @\caption{Raises a 90 degrees corner quadratic Bezier curve to a quintic
  2109. @        using CRAISE. The control polygons are also shown.}
  2110. @\label{fig-craise}
  2111. @\end{figure}
  2112. @\subsubsection{CREFINE}
  2113. !CREFINE
  2114. @\begin{verbatim}
  2115.  CurveType CREFINE( CurveType Curve, NumericType Replace, ListType KnotList )
  2116. @\end{verbatim}
  2117.    Provides the ability to {\bf Replace} a knot vector of {\bf Curve}, or refine 
  2118.  it. {\bf KnotList} is a list of knots to refine {\bf Curve} at. All knots
  2119.  should be contained in the parametric domain of the {\bf Curve}. If the knot
  2120.  vector is replaced, the length of {\bf KnotList} should be identical to the
  2121.  length of the original knot vector of the {\bf Curve}. If {\bf Curve} is a
  2122.  Bezier curve, it is automatically promoted to be a Bspline curve.
  2123.  Example:
  2124. @\begin{verbatim}
  2125.     Crv2 = CREFINE( Crv, FALSE, list( 0.25, 0.5, 0.75 ) );
  2126. @\end{verbatim}
  2127.  refines {\bf Crv} and adds three new knots at 0.25, 0.5, and 0.75.
  2128. @See Figure~\ref{fig-crefine}.
  2129. @\begin{figure}
  2130. @\vspace{2.5in}
  2131. @\special{psfile=user_man/crefine.ps hscale=70 vscale=70 hoffset=30 voffset=-230}
  2132. @\caption{Refines a 90 degrees corner quadratic Bezier curve at three interior
  2133. @        knots (result is a Bspline curve) using CREFINE.
  2134. @        The control polygons are also shown.}
  2135. @\label{fig-crefine}
  2136. @\end{figure}
  2137. @\subsubsection{CREGION}
  2138. !CREGION
  2139. @\begin{verbatim}
  2140.  CurveType CREGION( CurveType Curve, NumericType MinParam,
  2141.                                                        NumericType MaxParam )
  2142. @\end{verbatim}
  2143.    Extracts a region from {\bf Curve} between {\bf MinParam} and {\bf MaxParam}.
  2144.  Both {\bf MinParam} and {\bf MaxParam} should be contained in the
  2145.  parametric domain of the {\bf Curve}.
  2146.  Example:
  2147. @\begin{verbatim}
  2148.     SubCrv = CREGION( Crv, 0.3, 0.6 );
  2149. @\end{verbatim}
  2150.  extracts the region from {\bf Crv} from the parameter value 0.3 to the
  2151.  parameter value 0.6.
  2152. @See Figure~\ref{fig-cregion}.
  2153. @\begin{figure}
  2154. @\vspace{2.5in}
  2155. @\special{psfile=user_man/cregion.ps hscale=70 vscale=70 hoffset=30 voffset=-230}
  2156. @\caption{Extracts a sub region from a curve using CREGION.}
  2157. @\label{fig-cregion}
  2158. @\end{figure}
  2159. @\subsubsection{CREPARAM}
  2160. !CREPARAM
  2161. @\begin{verbatim}
  2162.  CurveType CREPARAM( CurveType Curve, NumericType MinParam,
  2163.                                                        NumericType MaxParam )
  2164. @\end{verbatim}
  2165.    Reparametrize {\bf Curve} over a new domain from {\bf MinParam} to {\bf MaxParam}.
  2166.  This operation does not affect the geometry of the curve and only affine
  2167.  transforms its knot vector. A Bezier curve will automatically be promoted
  2168.  into a Bspline curve by this function.
  2169.  Example:
  2170. @\begin{verbatim}
  2171.     arc1 = arc( vector( 0.0, 0.0, 0.0 ),
  2172.                 vector( 0.5, 2.0, 0.0 ),
  2173.                 vector( 1.0, 0.0, 0.0 ) );
  2174.     crv1 = arc( vector( 1.0, 0.0, 0.75 ),
  2175.                 vector( 0.75, 0.0, 0.7 ),
  2176.                 vector( 0.5,  0.0, 0.85 ) ) +
  2177.            arc( vector( 0.5,  0.0, 0.75 ),
  2178.                 vector( 0.75, 0.0, 0.8 ),
  2179.                 vector( 1.0,  0.0, 0.65 ) );
  2180.     arc1 = CREPARAM( arc1, 0, 10 );
  2181.     crv1 = CREPARAM( crv1, 0, 10 );
  2182. @\end{verbatim}
  2183.  Sets the domain of the given two curves to be from zero to ten. The
  2184.  Bezier curve arc1 is promoted to a Bspline curve.
  2185. @\subsubsection{CROSSEC}
  2186. !CROSSEC
  2187. @\begin{verbatim}
  2188.  PolygonType CROSSEC( PolygonType Object )
  2189. @\end{verbatim}
  2190. ;   Invoke interactive mode to edit/create a polygon in the plane Z = 0. The
  2191. ; polygon must be in the domain [0..1] in X,Y. The first polygon of the given
  2192. ; Object is copied to begin with. If the given {\bf Operand} is NOT a geometric
  2193. ; object, but FALSE (numeric 0.0), a new polygon is created. Returns an (open)
  2194. ; object with this one polygon only and inside side of $+Z$. Note that if the
  2195. ; given polygon (first polygon of Object) is not on the $XY$ plane, it is transformed
  2196. ; to it before editing, and transformed back after.
  2197.    This feature is NOT implemented.
  2198. @\subsubsection{CRVLNDST}
  2199. !CRVLNDST
  2200. @\begin{verbatim}
  2201.  NumericType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  2202.                                  NumericType IsMinDist, NumericType Epsilon )
  2203.  ListType CRVLNDST( CurveType Crv, PointType PtOnLine, VectorType LnDir,
  2204.                                 NumericType IsMinDist, NumericType Epsilon )
  2205. @\end{verbatim}
  2206.    Computes the closest (if {\bf IsMinDist} is TRUE, farthest if FALSE) point
  2207.  on {\bf Curve} to the line specified by {\bf PtOnLine} and {\bf LnDir} as a
  2208.  point on the line and a line direction.
  2209.    Since this operation is partially numeric, {\bf Epsilon} is used to set
  2210.  the needed accuracy. It returns the parameter value of the location on
  2211.  {\bf Crv} closest to the line.
  2212.    If, however, {\bf Epsilon} is negative, -{\bf Epsilon} is used instead,
  2213.  and all local extrema in the distance function are returned as a list
  2214.  (both minima and maxima).
  2215.    If the line and the curve intersect, the point of intersection is
  2216.  returned as the minimum.
  2217.  Example:
  2218. @\begin{verbatim}
  2219.     Param = CRVLNDST( Crv, linePt, lineVec, TRUE, 0.001 );
  2220. @\end{verbatim}
  2221.  finds the closest point on {\bf Crv} to the line defined by {\bf linePt}
  2222.  and {\bf lineVec}.
  2223. @See Figure~\ref{fig-crvlndst}.
  2224. @\begin{figure}
  2225. @\vspace{2.2in}
  2226. @\special{psfile=user_man/crvlndst.ps hscale=100 vscale=100 hoffset=-40 voffset=-240}
  2227. @\caption{Computes the locations on the freeform curve with local extreme
  2228. @        distance to the given line, using CRVLNDST.}
  2229. @\label{fig-crvlndst}
  2230. @\end{figure}
  2231. @\subsubsection{CRVPTDST}
  2232. !CRVPTDST
  2233. @\begin{verbatim}
  2234.  NumericType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  2235.                                                          NumericType Epsilon )
  2236.  ListType CRVPTDST( CurveType Crv, PointType Point, NumericType IsMinDist,
  2237.                                                          NumericType Epsilon )
  2238. @\end{verbatim}
  2239.    Computes the closest (if {\bf IsMinDist} is TRUE, farthest if FALSE) point
  2240.  on {\bf Crv} to {\bf Point}.
  2241.    Since this operation is partially numeric, {\bf Epsilon} is used to set
  2242.  the needed accuracy. It returns the parameter value of the location on
  2243.  {\bf Crv} closest to {\bf Point}.
  2244.    If, however, {\bf Epsilon} is negative, -{\bf Epsilon} is used instead,
  2245.  and all local extrema in the distance function are returned as a list
  2246.  (both minima and maxima).
  2247.  Example:
  2248. @\begin{verbatim}
  2249.     Param = CRVPTDST( Crv, Pt, FALSE, 0.0001 ); 
  2250. @\end{verbatim}
  2251.  finds the farthest point on {\bf Crv} from point {\bf Pt}.
  2252. @See Figure~\ref{fig-crvptdst}.
  2253. @\begin{figure}
  2254. @\vspace{2.2in}
  2255. @\special{psfile=user_man/crvptdst.ps hscale=100 vscale=100 hoffset=-40 voffset=-240}
  2256. @\caption{Computes the locations on the freeform curve with local extreme
  2257. @        distance to the given point, using CRVPTDST.}
  2258. @\label{fig-crvptdst}
  2259. @\end{figure}
  2260. @\subsubsection{CSURFACE}
  2261. !CSURFACE
  2262. @\begin{verbatim}
  2263.  CurveType CSURFACE( SurfaceType Srf, ConstantType Direction,
  2264.                                                           NumericType Param )
  2265. @\end{verbatim}
  2266.    Extract an isoparametric curve out of {\bf Srf} in the specified
  2267.  {\bf Direction} (ROW or COL) at the specified parameter value {\bf Param}.
  2268.  {\bf Param} must be contained in the parametric domain of {\bf Srf} in
  2269.  {\bf Direction} direction.
  2270.  The returned curve is {\em in} the surface {\bf Srf}.
  2271. @It is equal to,
  2272. @\begin{equation}
  2273. @     C(t) = S(t, v_0) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_i(t) B_j(v_0) =
  2274. @            \sum_{i=0}^m \left( \sum_{j=0}^n P_{ij} B_j(u_0) \right) B_i(t) =
  2275. @            \sum_{i=0}^m Q_i B_i(t),
  2276. @     \label{eqn-crv-from-srf}
  2277. @\end{equation}
  2278. @where $Q_i = \sum_{j=0}^n P_{ij} B_j(u_0)$ are the coefficients of the
  2279. @returned curve, and similar for the other parametric direction $S(u_0, t)$.
  2280. @{\bf param} is $v_0$ is equation~\eqnref{eqn-crv-from-srf}
  2281.  Example:
  2282. @\begin{verbatim}
  2283.     Crv = CSURFACE( Srf, COL, 0.45 ); 
  2284. @\end{verbatim}
  2285.  extracts an isoparametric curve in the COLumn direction at the parameter
  2286.  value of 0.15 from surface {\bf Srf}. See also CMESH, COMPOSE.
  2287. @See Figure~\ref{fig-csurface}.
  2288. @\begin{figure}
  2289. @\vspace{2.5in}
  2290. @\special{psfile=user_man/csurface.ps hscale=100 vscale=100 hoffset=-40 voffset=-180}
  2291. @\caption{Extracts an isoparametric curve from the given surface, using CSURFACE.}
  2292. @\label{fig-csurface}
  2293. @\end{figure}
  2294. @\subsubsection{CTANGENT}
  2295. !CTANGENT
  2296. @\begin{verbatim}
  2297.  VectorType CTANGENT( CurveType Curve, NumericType Param )
  2298. @\end{verbatim}
  2299.    Computes the tangent vector to {\bf Curve} at the parameter value {\bf Param}.
  2300.    The returned vector has a unit length.
  2301.  Example:
  2302. @\begin{verbatim}
  2303.     Tang = CTANGENT( Crv, 0.5 );
  2304. @\end{verbatim}
  2305.  computes the tangent vector to {\bf Crv} at the parameter value of 0.5.
  2306. @\subsubsection{CTLPT}
  2307. !CTLPT
  2308. @\begin{verbatim}
  2309.  CPt = CTLPT( ConstantType PtType, NumericType Coord1, ... )
  2310. @\end{verbatim}
  2311.    Constructs a single control point to be used in the construction of curves
  2312.  and surfaces. Points can have from one to five dimensions, and may be
  2313.  either Euclidean or Projective (rational). Points' type is set via the
  2314.  constants E1 to E5 and P1 to P5. The coordinates of the point are specified
  2315.  in order, weight is first if rational.
  2316.  Examples:
  2317. @\begin{verbatim}
  2318.     CPt1 = CTLPT( E3, 0.0, 0.0, 0.0 );
  2319.     CPt2 = CTLPT( P2, 0.707, 0.707, 0.707 );
  2320. @\end{verbatim}
  2321.  constructs an {\bf E3} point at the origin and a P2 rational point with
  2322.  a weight of 0.707. The Projective Pi points are specified as
  2323.  CTLPT(Pn, W, W X1, ... , W Xn).
  2324. @\subsubsection{CTRIMSRF}
  2325. !CTRIMSRF
  2326. @\begin{verbatim}
  2327.  ListType CTRIMSRF( TrimSrfType TSrf, NumericType Parametric )
  2328. @\end{verbatim}
  2329.    Extract the trimming curves of a trimmed surface {\bf TSrf}.
  2330.  If {\bf Parametric} is not zero, then the trimming curves are extracted
  2331.  as parametric space curves of {\bf TSrf}. Otherwise, the trimming curves
  2332.  are evaluated into Euclidean space as curves on surface {\bf TSrf}.
  2333.  Example:
  2334. @\begin{verbatim}
  2335.     TrimCrvs = CTRIMSRF( TrimSrf, FALSE ); 
  2336. @\end{verbatim}
  2337.  extracts the trimming curves of {\bf TrimSrf} as Euclidean curves on
  2338.  {\bf TrimSrf}.
  2339. @See Figure~\ref{fig-ctrimsrf}.
  2340. @\begin{figure}
  2341. @\vspace{3.4in}
  2342. @\special{psfile=user_man/ctrimsrf.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
  2343. @\caption{Extracts the trimming curves in Euclidean space (middle) and
  2344. @       parametric space (right) of a trimmed surface (left), using CTRIMSRF.}
  2345. @\label{fig-ctrimsrf}
  2346. @\end{figure}
  2347. @\subsubsection{CYLIN}
  2348. !CYLIN
  2349. @\begin{verbatim}
  2350.  PolylineType CYLIN( VectorType Center, VectorType Direction,
  2351.                      NumericType Radius )
  2352. @\end{verbatim}
  2353.    Creates a CYLINder geometric object, defined by {\bf Center} as center of
  2354.  the base of the CYLINder, {\bf Direction} as the CYLINder's axis and height,
  2355.  and {\bf Radius} as the radius of the base of the CYLINder.
  2356.    See RESOLUTION for the accuracy of the CYLINder approximation as a
  2357.  polygonal model.
  2358.  Example:
  2359. @\begin{verbatim}
  2360.     Cylinder1 = CYLIN( vector( 0, 0, 0 ), vector( 1, 0, 0 ), 10 );
  2361. @\end{verbatim}
  2362.  constructs a cylinder along the $X$ axis from the origin to $X = 10$.
  2363. @See Figure~\ref{fig-cylinder}.
  2364. @\begin{figure}
  2365. @\vspace{1.4in}
  2366. @\special{psfile=user_man/cylinder.ps hscale=100 vscale=100 hoffset=-40 voffset=-180}
  2367. @\caption{A cylinder primitive can be constructor using the CYLIN constructor.}
  2368. @\label{fig-cylinder}
  2369. @\end{figure}
  2370. @\subsubsection{CZEROS}
  2371. !CZEROS
  2372. @\begin{verbatim}
  2373.  ListType CZEROS( CurveType Crv, NumericType Epsilon, NumericType Axis )
  2374. @\end{verbatim}
  2375.    Computes the zero set of the given {\bf Crv} in the given axis (1 for X,
  2376.  2 for Y, 3 for Z). Since this computation is numeric, an {\bf Epsilon} is
  2377.  also required to specify the desired tolerance. It returns a list of
  2378.  all the parameter values (NumericType) the curve is zero.
  2379.  Example:
  2380. @\begin{verbatim}
  2381.     xzeros = CZEROS( cb, 0.001, 1 );
  2382.     pt_xzeros = nil();
  2383.     pt = nil();
  2384.     for ( i = 1, 1, sizeof( xzeros ),
  2385.             pt = ceval( cb, nth( xzeros, i ) ):
  2386.             snoc( pt, pt_xzeros )
  2387.         );
  2388.     interact( list( axes, cb, pt_xzeros ), 0 );
  2389. @\end{verbatim}
  2390.  Computes the {\bf X} zero set of curve {\bf cb} with error tolerance
  2391.  of {\bf 0.001}. This set is then scanned in a loop and evaluated to
  2392.  the curve's locations, which are then displayed.
  2393.  See also CINFLECT.
  2394. @See Figure~\ref{fig-czeros}.
  2395. @\begin{figure}
  2396. @\vspace{3.6in}
  2397. @\special{psfile=user_man/czeros.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  2398. @\caption{Computes the zero set of a given freeform curve, in the given axis, using
  2399. @        CZEROS.}
  2400. @\label{fig-czeros}
  2401. @\end{figure}
  2402. @\subsubsection{EXTRUDE}
  2403. !EXTRUDE
  2404. @\begin{verbatim}
  2405.  PolygonType EXTRUDE( PolygonType Object, VectorType Dir )
  2406.  SurfaceType EXTRUDE( CurveType Object, VectorType Dir )
  2407. @\end{verbatim}
  2408.    Creates an extrusion of the given {\bf Object}. If {\bf Object} is a
  2409.  PolygonObject, its first polygon is used as the base for the extrusion in
  2410.  {\bf Dir} direction, and a closed PolygonObject is constructed. If {\bf Object}
  2411.  is a CurveType, an extrusion surface is constructed instead, which is {\em not}
  2412.  a closed object (the two bases of the extrusion are excluded, and the curve
  2413.  may be open by itself).
  2414.    Direction {\bf Dir} cannot be coplanar with the polygon plane. The curve
  2415.  may be nonplanar.
  2416.  Example:
  2417. @\begin{verbatim}
  2418.     Cross = cbspline( 3,
  2419.                       list( ctlpt( E2, -0.018, 0.001 ),
  2420.                             ctlpt( E2,  0.018, 0.001 ),
  2421.                             ctlpt( E2,  0.019, 0.002 ),
  2422.                             ctlpt( E2,  0.018, 0.004 ),
  2423.                             ctlpt( E2, -0.018, 0.004 ),
  2424.                             ctlpt( E2, -0.019, 0.001 ) ),
  2425.                       list( KV_OPEN ) );
  2426.     Cross = Cross + -Cross * scale( vector( 1, -1, 1 ) );
  2427.     Napkin = EXTRUDE( Cross * scale( vector( 1.6, 1.6, 1.6 ) ),
  2428.                       vector( 0.02, 0.03, 0.2 ) );
  2429. @\end{verbatim}
  2430.  constructs a closed cross section {\bf Cross} by duplicating one half of
  2431.  it in reverse and merging the two sub-curves. {\bf Cross} is then used as
  2432.  the cross-section for the extrusion operation.
  2433. @See Figure~\ref{fig-extrude}.
  2434. @\begin{figure}
  2435. @\vspace{1.5in}
  2436. @\special{psfile=user_man/extrude.ps hscale=100 vscale=100 hoffset=-40 voffset=-310}
  2437. @\caption{An extrusion of a freeform curve using EXTRUDE to create a freeform
  2438. @        surface.}
  2439. @\label{fig-extrude}
  2440. @\end{figure}
  2441. @\subsubsection{FFCOMPAT}
  2442. !FFCOMPAT
  2443. @\begin{verbatim}
  2444.  FFCOMPAT( CurveType Crv1, CurveType Crv2 )
  2445.  FFCOMPAT( SurfaceType Srf1, SurfaceType Srf2 )
  2446. @\end{verbatim}
  2447.  Makes the given two curves or surfaces compatible by making them share the
  2448.  same point type, same curve type, same degree, and the same continuity.
  2449.  Same point type is gained by promoting a lower dimension into a higher one,
  2450.  and non-rational to rational points. Bezier curves are promoted to Bspline
  2451.  curves if necessary, for curve type compatibility. Degree compatibility is
  2452.  achieved by raising the degree of the lower order curve. Continuity is
  2453.  achieve by refining both curves to the space with the same (unioned) knot
  2454.  vector. This function returns nothing and compatibility is made
  2455.  {\em in place}.
  2456.  Example:
  2457. @\begin{verbatim}
  2458.  FFCOMPAT( Srf1, Srf2 );
  2459. @\end{verbatim}
  2460.  See also SMORPH.
  2461. @\subsubsection{FFEXTREME}
  2462. !FFEXTREME
  2463. @\begin{verbatim}
  2464.  CtlPtType FFEXTREME( CurveType Crv, NumericType Minimum )
  2465.  CtlPtType FFEXTREME( SurfaceType Srf, NumericType Minimum )
  2466. @\end{verbatim}
  2467.  Computes a bound on the extreme values a curves {\bf Crv} or surface
  2468.  {\bf Srf} can assume. Returned control points provides a bound on the
  2469.  minimum (maximum) values that can be assumed if {\bf Minimum} is TRUE
  2470.  (FALSE).
  2471.  Example:
  2472. @\begin{verbatim}
  2473.  Bound = FFEXTREME( Srf, false );
  2474. @\end{verbatim}
  2475.  Computes a bound on the maximal values Srf can assume.
  2476. @\subsubsection{GBOX}
  2477. !GBOX
  2478. @\begin{verbatim}
  2479.  PolygonType GBOX( VectorType Point,
  2480.                    VectorType Dx, VectorType Dy, VectorType Dz )
  2481. @\end{verbatim}
  2482.    Creates a parallelepiped - Generalized BOX polygonal object, defined by
  2483.  {\bf Point} as base position, and {\bf Dx, Dy, Dz} as 3 3D vectors to define
  2484.  the 6 faces of this generalized BOX. The regular BOX object is a special case
  2485.  of GBOX where {\bf Dx} = vector(Dx, 0, 0), {\bf Dy} = vector(0, Dy, 0), and
  2486.  {\bf Dz} = vector(0, 0, Dz).
  2487.    {\bf Dx}, {\bf Dy}, {\bf Dz} must all be independent in order to create an
  2488.  object with positive volume.
  2489.  Example:
  2490. @\begin{verbatim}
  2491.     GB = GBOX(vector(0.0, -0.35, 0.63), vector(0.5, 0.0, 0.5),
  2492.                                         vector(-0.5, 0.0, 0.5),
  2493.                                         vector(0.0, 0.7, 0.0));
  2494. @\end{verbatim}
  2495. @See Figure~\ref{fig-gbox}.
  2496. @\begin{figure}
  2497. @\vspace{2.9in}
  2498. @\special{psfile=user_man/gbox.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  2499. @\caption{A warped box in a general position can be constructed using the GBOX
  2500. @        constructor.}
  2501. @\label{fig-gbox}
  2502. @\end{figure}
  2503. @\subsubsection{GETLINE}
  2504. !GETLINE
  2505. @\begin{verbatim}
  2506.  AnyType GETLINE( NumericType RequestedType )
  2507. @\end{verbatim}
  2508.    Provides a method to get input from keyboard within functions and
  2509.  or subroutines. {\bf RequestedType} can be one of NUMERIC\_TYPE,
  2510.  POINT\_TYPE, VECTOR\_TYPE, or PLANE\_TYPE in which the entered line
  2511.  will be parsed into one, three, or four numeric values (sperated by
  2512.  either spaces or commas) and the proper object will be created and
  2513.  returned. In any other case, including failure to parse the numeric
  2514.  input, a STRING\_TYPE object will be constructed from the entered line.
  2515.  Example:
  2516. @\begin{verbatim}
  2517.     Pt = GETLINE( point_type );
  2518. @\end{verbatim}
  2519.  to read one point (three numeric values) from stdin.
  2520. @\subsubsection{GPOLYGON}
  2521. !GPOLYGON
  2522. @\begin{verbatim}
  2523.  PolygonType GPOLYGON( GeometryTreeType Object, NumericType Normals )
  2524. @\end{verbatim}
  2525.    Approximates all Surface(s)/Trimmed surface(s)/Trivariate(s) in {\bf Object}
  2526.  with polygons using the RESOLUTION and FLAT4PLY variables. The larger the
  2527.  RESOLUTION is, the finer (more polygons) the resulting approximation will be.
  2528.    FLAT4PLY is a Boolean flag controlling the conversion of an (almost) flat
  2529.  patch into four (TRUE) or two (FALSE) polygons. Normals are computed to
  2530.  polygon vertices using surface normals, so Gouraud or Phong shading can be
  2531.  exploited. It returns a single polygonal object.
  2532.    If {\bf Normals} is set, surface normals will be evaluated at the
  2533.  vertices. Otherwise flat shading and constant normals across polygons are
  2534.  assumed.
  2535.  Example:
  2536. @\begin{verbatim}
  2537.     Polys = GPOLYGON( list( Srf1, Srf2, Srf3 ), off );
  2538. @\end{verbatim}
  2539.  Converts to polygons the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
  2540.  with no normals.
  2541. @\subsubsection{GPOLYLINE}
  2542. !GPOLYLINE
  2543. @\begin{verbatim}
  2544.  PolylineType GPOLYLINE( GeometryTreeType Object, NumericType Optimal )
  2545. @\end{verbatim}
  2546.    Converts all Curves(s), (Trimmed) Surface(s), and Trivariate(s) {\bf Object}
  2547.  into polylines using the RESOLUTION variable. The larger the RESOLUTION is,
  2548.  the finer the resulting approximation will be. It returns a single polyline
  2549.  object.
  2550.    If {\bf Optimal} is false, the points are sampled at equally spaced
  2551.  interval in the parametric space. If {\bf Optimal} true, a better, more
  2552.  expensive computationally, algorithm is used to derive optimal sampling
  2553.  locations as to minimize the maximal distance between the curve and
  2554.  piecewise linear approximation (L infinity norm).
  2555.  Example:
  2556. @\begin{verbatim}
  2557.     Polys = GPOLYLINE( list( Srf1, Srf2, Srf3, list( Crv1, Crv2, Crv3 ) ),
  2558.                        on );
  2559. @\end{verbatim}
  2560.  converts to polylines the three surfaces {\bf Srf1}, {\bf Srf2}, and {\bf Srf3}
  2561.  and the three curves {\bf Crv1}, {\bf Crv2}, and {\bf Crv3}.
  2562. @\subsubsection{LOFFSET}
  2563. !LOFFSET
  2564. @\begin{verbatim}
  2565.  CurveType LOFFSET( CurveType Crv, NumericType OffsetDistance,
  2566.                     NumericType NumOfSamples, NumericType NumOfDOF,
  2567.                     NumericType Order )
  2568. @\end{verbatim}
  2569.  Approximate an offset of {\bf OffsetDistance} by sampling {\bf NumOfSamples}
  2570.  samples along the offset curve and least square fitting them using a Bspline
  2571.  curve of order {\bf Order} and {\bf NumOfDOF} control points.
  2572.  Example:
  2573. @\begin{verbatim}
  2574.     OffCrv1 = LOFFSET( Crv, -0.4, 100, 10, 4 );
  2575. @\end{verbatim}
  2576.  See also OFFSET and AOFFSET.
  2577. @\subsubsection{MERGPOLY}
  2578. !MERGEPOLY
  2579. @\begin{verbatim}
  2580.  PolygonType MERGEPOLY( ListType PolyList )
  2581. @\end{verbatim}
  2582.  Merges a set of polygonal objects in {\bf PolyList} list to a single polygonal
  2583.  object. All elements in {\bf ObjectList} must be of PolygonType type. This
  2584.  function performs the same operation as the overloaded {\bf \verb+^+} operator
  2585.  would, but might be more convenient to use under some circumstances.
  2586.  Example:
  2587. @\begin{verbatim}
  2588.     Vrtx1 = vector( -3, -2, -1 );
  2589.     Vrtx2 = vector( 3, -2, -1 );
  2590.     Vrtx3 = vector( 3, 2, -1 );
  2591.     Vrtx4 = vector( -3, 2, -1 );
  2592.     Poly1 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false ); 
  2593.     Vrtx1 = vector( -3, 2, 1 );
  2594.     Vrtx2 = vector( 3, 2, 1 );
  2595.     Vrtx3 = vector( 3, -2, 1 );
  2596.     Vrtx4 = vector( -3, -2, 1 );
  2597.     Poly2 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  2598.     Vrtx1 = vector( -3, -2, 1 );
  2599.     Vrtx2 = vector( 3, -2, 1 );
  2600.     Vrtx3 = vector( 3, -2, -1 );
  2601.     Vrtx4 = vector( -3, -2, -1 );
  2602.     Poly3 = poly( list( Vrtx1, Vrtx2, Vrtx3, Vrtx4 ), false );
  2603.     PolyObj = MERGEPOLY( list( Poly1, Poly2, Poly3 ) );
  2604. @\end{verbatim}
  2605. @See Figure~\ref{fig-mergpoly}.
  2606. @\begin{figure}
  2607. @\vspace{2.6in}
  2608. @\special{psfile=user_man/mergpoly.ps hscale=100 vscale=100 hoffset=-40 voffset=-220}
  2609. @\caption{Individual polygons can be merged into a complete model using MERGEPOLY.}
  2610. @\label{fig-mergpoly}
  2611. @\end{figure}
  2612. @\subsubsection{MOMENT}
  2613. !MOMENT
  2614. @\begin{verbatim}
  2615.  PointType MOMENT( CurveType Crv, 0 );
  2616.  VectorType MOMENT( CurveType Crv, 1 );
  2617. @\end{verbatim}
  2618.  Approximates the zero and first moment of curve {\bf Crv}.
  2619.  Example:
  2620. @\begin{verbatim}
  2621.     a = circle( vector( 0, 0, 0 ), 1 );
  2622.     a = cregion( a, 0, 1 );
  2623.     p = moment( a, 0 );
  2624.     v = moment( a, 1 );
  2625.     view(list(a, p, v), on);
  2626.     a = cregion( a, 0, 1 ) * rz( 45 );
  2627.     p = moment( a, 0 );
  2628.     v = moment( a, 1 );
  2629.     view(list(a, p, v), on);
  2630. @\end{verbatim}
  2631.  computes and displays the zero and first moment of a quarter of a circle
  2632.  in two orientations.
  2633. @\subsubsection{NIL}
  2634. @\begin{verbatim}
  2635.  ListType NIL()
  2636. @\end{verbatim}
  2637.    Creates an empty list so data can be accumulated in it.
  2638.  See CINFLECT or CZEROS for examples. See also LIST and SNOC.
  2639. @\subsubsection{OFFSET}
  2640. !OFFSET
  2641. @\begin{verbatim}
  2642.  CurveType OFFSET( CurveType Crv, NumericType OffsetDistance,
  2643.                    NumericType Tolerance, NumericType BezInterp )
  2644.  SurfaceType OFFSET( SurfaceType Srf, NumericType OffsetDistance,
  2645.                      NumericType Tolerance )
  2646. @\end{verbatim}
  2647.  Offsets {\bf Crv} or {\bf Srf}, by translating all the control points in the
  2648.  direction of the normal of the curve or surface by an {\bf OffsetDistance}
  2649.  amount. Each control point has a {\em node} parameter value associated with
  2650.  it, which is used to compute the normal. The returned curve or surface only
  2651.  approximates the real offset. If the resulting approximation does not satisfy
  2652.  the accuracy required by {\bf Tolerance}, {\bf Crv} or {\bf Srf} is subdivided
  2653.  and an offset approximation fit is computed to the two halfs. For curves, one
  2654.  can request a Bezier interpolation scheme in the offset approximation by
  2655.  setting {\bf BezInter}. Negative {\bf OffsetDistance} denotes offset in
  2656.  the reversed direction of the normal.
  2657.  Example:
  2658. @\begin{verbatim}
  2659.     OffCrv = OFFSET( Crv, -0.4, 0.1, off );
  2660. @\end{verbatim}
  2661.  offsets {\bf Crv} by the amount of $-0.4$ in the reversed normal direction,
  2662.  {\bf Tolerance} of 0.1 and no Bezier interpolation.
  2663.  See also AOFFSET and LOFFSET.
  2664. @See Figure~\ref{fig-coffset}.
  2665. @\begin{figure}
  2666. @\vspace{2.5in}
  2667. @\special{psfile=user_man/coffset.ps hscale=100 vscale=100 hoffset=-40 voffset=-190}
  2668. @\caption{Offset approximation (thick) of a Bspline curve (thin) (See also
  2669. @        Figure~\protect\ref{fig-caoffset}.)}
  2670. @\label{fig-coffset}
  2671. @\end{figure}
  2672. @\subsubsection{PCIRCLE}
  2673. !PCIRCLE
  2674. @\begin{verbatim}
  2675.  CurveType PCIRCLE( VectorType Center, NumericType Radius )
  2676. @\end{verbatim}
  2677.  Same as CIRCLE but approximates the circle as a {\em polynomial} curve.
  2678.  See CIRCLE.
  2679. @\subsubsection{PDOMAIN}
  2680. !PDOMAIN
  2681. @\begin{verbatim}
  2682.  ListType PDOMAIN( CurveType Crv )
  2683.  ListType PDOMAIN( SurfaceType Srf )
  2684.  ListType PDOMAIN( TrimSrfType TrimSrf )
  2685.  ListType PDOMAIN( TrivarType TV )
  2686. @\end{verbatim}
  2687.    Returns the parametric domain of the curve (TMin, TMax) or of a (trimmed)
  2688.  surface (UMin, UMax, VMin, VMax) or of a trivariate function
  2689.  (UMin, UMax, VMin, VMax, WMin, WMax) as a list object.
  2690.  Example:
  2691. @\begin{verbatim}
  2692.  circ_domain = PDOMAIN( circle( vector( 0.0, 0.0, 0.0 ), 1.0 ) );
  2693. @\end{verbatim}
  2694. @\subsubsection{POLY}
  2695. !POLY
  2696. @\begin{verbatim}
  2697.  PolygonType POLY( ListType VrtxList, NumericType IsPolyline )
  2698. @\end{verbatim}
  2699.    Creates a single polygon/polyline (and therefore open) object, defined by
  2700.  the vertices in {\bf VrtxList} (see LIST). All elements in {\bf VrtxList}
  2701.  must be of VectorType type. If {\bf IsPolyline}, a polyline is created,
  2702.  otherwise a polygon.
  2703.  Example:
  2704. @\begin{verbatim}
  2705.     V1  = vector( 0.0, 0.0, 0.0 );
  2706.     V2  = vector( 0.3, 0.0, 0.0 );
  2707.     V3  = vector( 0.3, 0.0, 0.1 );
  2708.     V4  = vector( 0.2, 0.0, 0.1 );
  2709.     V5  = vector( 0.2, 0.0, 0.5 );
  2710.     V6  = vector( 0.3, 0.0, 0.5 );
  2711.     V7  = vector( 0.3, 0.0, 0.6 );
  2712.     V8  = vector( 0.0, 0.0, 0.6 );
  2713.     V9  = vector( 0.0, 0.0, 0.5 );
  2714.     V10 = vector( 0.1, 0.0, 0.5 );
  2715.     V11 = vector( 0.1, 0.0, 0.1 );
  2716.     V12 = vector( 0.0, 0.0, 0.1 );
  2717.     I = POLY( list( V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11, V12 ),
  2718.               FALSE );
  2719. @\end{verbatim}
  2720.  constructs an object with a single polygon in the shape of the letter I.
  2721. @See Figure~\ref{fig-poly}.
  2722. @\begin{figure}
  2723. @\vspace{1.7in}
  2724. @\special{psfile=user_man/poly.ps hscale=100 vscale=100 hoffset=-40 voffset=-200}
  2725. @\caption{Polygons or polylines can be manually constructed using the
  2726. @        POLY constructor.}
  2727. @\label{fig-poly}
  2728. @\end{figure}
  2729. @\subsubsection{PRISA}
  2730. !PRISA
  2731. @\begin{verbatim}
  2732.  ListType PRISA( SurfaceType Srfs, NumericType SamplesPerCurve,
  2733.                  NumericType Epsilon, ConstantType Dir, VectorType Space )
  2734. @\end{verbatim}
  2735.    Computes a layout (prisa) of the given surface(s) {\bf Srfs}, and returns
  2736.  a list of surface objects representing the layout.
  2737.    The surface is approximated to within {\bf Epsilon} in direction {\bf Dir}
  2738.  into a set of ruled surfaces and then developable surfaces that are laid out
  2739.  flat onto the $XY$ plane. If {\bf Epsilon} is negative, the piecewise ruled
  2740.  surface approximation in 3-space is returned. 
  2741.    {\bf SamplesPerCurve} controls the piecewise linear approximation of the
  2742.  boundary of the ruled/developable surfaces. {\bf Space} is a vector whose
  2743.  X component controls the space between the different surfaces' layout, and
  2744.  whose Y component controls the space between different layout pieces.
  2745.  Example:
  2746. @\begin{verbatim}
  2747.  cross = cbspline( 3,
  2748.                    list( ctlpt( E3, 0.7, 0.0, 0. ),
  2749.                          ctlpt( E3, 0.7, 0.0, 0.06 ),
  2750.                          ctlpt( E3, 0.1, 0.0, 0.1 ),
  2751.                          ctlpt( E3, 0.1, 0.0, 0.6 ),
  2752.                          ctlpt( E3, 0.6, 0.0, 0.6 ),
  2753.                          ctlpt( E3, 0.8, 0.0, 0.8 ),
  2754.                          ctlpt( E3, 0.8, 0.0, 1.4 ),
  2755.                          ctlpt( E3, 0.6, 0.0, 1.6 ) ),
  2756.                    list( KV_OPEN ) );
  2757.  wglass = surfrev( cross );
  2758.  wgl_ruled = PRISA( wglass, 6, -0.1, COL, vector( 0, 0.25, 0.0 ) );
  2759.  wgl_prisa = PRISA( wglass, 6, 0.1, COL, vector( 0, 0.25, 0.0 ) );
  2760. @\end{verbatim}
  2761.  Computes a layout of a wine glass in {\bf wgl\_prisa} and a three-dimensional
  2762.  ruled surface approximation of wglass in {\bf wgl\_ruled}.
  2763. @See Figure~\ref{fig-prisa}.
  2764. @\begin{figure}
  2765. @\vspace{2.4in}
  2766. @\special{psfile=user_man/prisa.ps hscale=100 vscale=100 hoffset=-30 voffset=-210}
  2767. @\caption{The layout (prisa in hebrew...) of a freeform surface can be approximated
  2768. @        using the PRISA function.}
  2769. @\label{fig-prisa}
  2770. @\end{figure}
  2771. @\subsubsection{RULEDSRF}
  2772. !RULEDSRF
  2773. @\begin{verbatim}
  2774.  SurfaceType RULEDSRF( CurveType Crv1, CurveType Crv2 )
  2775. @\end{verbatim}
  2776.    Constructs a ruled surface between the two curves {\bf Crv1} and {\bf Crv2}.
  2777.    The curves do not have to have the same order or type, and will be promoted
  2778.  to their least common denominator.
  2779.  Example:
  2780. @\begin{verbatim}
  2781.     Circ = circle( vector( 0.0, 0.0, 0.0 ), 0.25 );
  2782.     Cyl = RULEDSRF( circ, circ * trans( vector( 0.0, 0.0, 1.0 ) ) );
  2783. @\end{verbatim}
  2784.  Constructs a cylinder of radius 0.25 along the Z axis from 0 to 1.
  2785. @See Figure~\ref{fig-ruledsrf}.
  2786. @\begin{figure}
  2787. @\vspace{2in}
  2788. @\special{psfile=user_man/ruledsrf.ps hscale=100 vscale=100 hoffset=-40 voffset=-210}
  2789. @\caption{A cylinder can be cunstructed as a RULEDSRF of two different circles.}
  2790. @\label{fig-ruledsrf}
  2791. @\end{figure}
  2792. @\subsubsection{SBEZIER}
  2793. !SBEZIER
  2794. @\begin{verbatim}
  2795.  SurfaceType SBEZIER( ListType CtlMesh )
  2796. @\end{verbatim}
  2797.    Creates a Bezier surface using the provided control mesh. {\bf CtlMesh} is a
  2798.  list of rows, each of which is a list of control points. All control points
  2799.  must be of type (E1-E5, P1-P5), or regular PointType defining the surface's
  2800.  control polygon. Surface's point type will be of a space which is the union
  2801.  of the spaces of all points.
  2802. @The created surface is the piecewise polynomial (or rational) surface,
  2803. @\begin{equation}
  2804. @     S(u, v) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_i(u) B_j(v)
  2805. @\end{equation}
  2806. @where $P_{ij}$ are the control points {\bf CtlMesh}. and $m$ and $n$ are the
  2807. @degrees of the surface, which are one less than the number of points in the
  2808. @appropriate direction.
  2809.  Example:
  2810. @\begin{verbatim}
  2811.    Srf = SBEZIER( list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  2812.                                ctlpt( E3, 0.0, 1.0, 0.0 ),
  2813.                                ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  2814.                          list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  2815.                                ctlpt( E3, 1.0, 1.0, 2.0 ),
  2816.                                ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  2817.                          list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  2818.                                ctlpt( E3, 2.0, 1.0, 0.0 ),
  2819.                                ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  2820.                          list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  2821.                                ctlpt( E3, 3.0, 1.0, 2.0 ),
  2822.                                ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  2823.                          list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  2824.                                ctlpt( E3, 4.0, 1.0, 0.0 ),
  2825.                                ctlpt( E3, 4.0, 2.0, 1.0 ) ) ) );
  2826. @\end{verbatim}
  2827. @See Figure~\ref{fig-surface}.
  2828. @\begin{figure}
  2829. @\vspace{1.5in}
  2830. @\special{psfile=user_man/surface.ps hscale=100 vscale=100 hoffset=-70 voffset=-170}
  2831. @\caption{A bezier surface (left) of degree 3 by 5 and a Bspline surface (right)
  2832. @        of degree 3 by 3 (bi-quadratic). Both share the same control mesh.}
  2833. @\label{fig-surface}
  2834. @\end{figure}
  2835. @\subsubsection{SBSPLINE}
  2836. !SBSPLINE
  2837. @\begin{verbatim}
  2838.  SurfaceType SBSPLINE( NumericType UOrder, NumericType VOrder,
  2839.                        ListType CtlMesh, ListType KnotVectors )
  2840. @\end{verbatim}
  2841.    Creates a Bspline surface from the provided {\bf UOrder} and {\bf VOrder}
  2842.  orders, the control mesh {\bf CtlMesh}, and the two knot vectors {\bf KnotVectors}.
  2843.  {\bf CtlMesh} is a list of rows, each of which is a list of control points.
  2844.  All control points must be of point type (E1-E5, P1-P5), or regular
  2845.  PointType defining the surface's control mesh. Surface's point type will
  2846.  be of a space which is the union of the spaces of all points.
  2847.    {\bf KnotVectors} is a list of two knot vectors. Each knot vector is a
  2848.  list of NumericType knots of length {\bf \#CtlPtList} plus the {\bf Order}.
  2849.  If, however, the length of the knot vector is equal to {\bf \#CtlPtList +
  2850.  Order + Order - 1} the curve is assumed {\em periodic.} 
  2851.    The knot vector may also be a list of a single constant KV\_OPEN or
  2852.  KV\_FLOAT or KV\_PERIODIC, in which a uniform knot vector with the
  2853.  appropriate length and with open, floating or periodic end condition
  2854.  will be constructed automatically.
  2855. @The created surface is the piecewise polynomial (or rational) surface,
  2856. @\begin{equation}
  2857. @     S(u, v) = \sum_{i=0}^m \sum_{j=0}^n P_{ij} B_{i,\chi}(u) B_{j,\xi}(v)
  2858. @\end{equation}
  2859. @where $P_{ij}$ are the control points {\bf CtlMesh}, and $m$ and $n$ are the
  2860. @degrees of the surface, which are one less than {\bf UOrder} and {\bf VOrder}.
  2861. @$\chi$ and $\xi$ are the two knot vectors of the surface.
  2862.  Example:
  2863. @\begin{verbatim}
  2864.     Mesh = list ( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  2865.                         ctlpt( E3, 0.0, 1.0, 0.0 ),
  2866.                         ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  2867.                   list( ctlpt( E3, 1.0, 0.0, 0.0 ),
  2868.                         ctlpt( E3, 1.0, 1.0, 2.0 ),
  2869.                         ctlpt( E3, 1.0, 2.0, 0.0 ) ),
  2870.                   list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  2871.                         ctlpt( E3, 2.0, 1.0, 0.0 ),
  2872.                         ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  2873.                   list( ctlpt( E3, 3.0, 0.0, 0.0 ),
  2874.                         ctlpt( E3, 3.0, 1.0, 2.0 ),
  2875.                         ctlpt( E3, 3.0, 2.0, 0.0 ) ),
  2876.                   list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  2877.                         ctlpt( E3, 4.0, 1.0, 0.0 ),
  2878.                         ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  2879.     Srf = SBSPLINE( 3, 3, Mesh, list( list( KV_OPEN ),
  2880.                                       list( 3, 3, 3, 4, 5, 6, 6, 6 ) ) );
  2881. @\end{verbatim}
  2882.  constructs a bi-quadratic Bspline surface with its first knot vector
  2883.  having uniform knot spacing with open end conditions.
  2884. @See Figure~\ref{fig-surface}.
  2885. @\subsubsection{SCRVTR}
  2886. !SCRVTR
  2887. @\begin{verbatim}
  2888.  SurfaceType SCRVTR( SurfaceType Srf, ConstType PtType, ConstType Dir )
  2889. @\end{verbatim}
  2890.    Symbolically computes the extreme curvature bound on {\bf Srf}.
  2891.    If {\bf Dir} is either ROW or COL, then the normal curvature square
  2892.  of {\bf Srf} in {\bf Dir} is computed symbolically and returned.
  2893.    Otherwise, a upper bound on the sum of the squares of the two
  2894.  principal curvatures is symbolically computed and returned.
  2895.    Returned value is a surface that can be evaluated to the curvature
  2896.  bound, given a UV location. The returned surface value is a scalar field
  2897.  of point type P1 (scalar rational).
  2898.    However, if {\bf PtType} is one of E1, P1, E3, P3 the returned surface
  2899.  is coerced to this given type. If the types are one of E3, P3, then the
  2900.  Y and Z axes are set to be equivalent to the U and V parametric domains.
  2901. @   This function computes the square of the normal curvature scalar
  2902. @ field for surfaces as (in the U parametric direction, same for V),
  2903. @\begin{equation}
  2904. @      \kappa_n^u(u, v) = \frac{\inner{n}{\frac{\partial^2 S}{\partial u^2}}}
  2905. @                              {\inner{\frac{\partial S}{\partial u}}
  2906. @                                     {\frac{\partial S}{\partial u}}}
  2907. @\end{equation}
  2908. @ and computes $\xi(u, v) = k_1(u, v)^2 + k_2(u, v)^2$ as the scalar field of
  2909. @\begin{equation}
  2910. @       \xi(u, v) = \frac{(g_{11} l_{22} + l_{11} g_{22} - 2 g_{12}
  2911. @                l_{12}) ^ 2 - 2 \left| G \right| \left| L \right|}
  2912. @               {\left| G \right|^2 \| n \|^2},
  2913. @\end{equation}
  2914. @ where $g_{ij}$ and $l_{ij}$ are the coefficients of the first and second
  2915. @ fundamental forms G and L.
  2916. ^   This function computes the square of the normal curvature scalar
  2917. ^ field for surfaces as (in the U parametric direction, same for V),
  2918. ^                     2  
  2919. ^                    d S
  2920. ^              < n , --- >
  2921. ^                      2
  2922. ^    u               du
  2923. ^   k (u, v) = ------------
  2924. ^    n         
  2925. ^                 dS   ds
  2926. ^               < -- , -- >
  2927. ^                 du   du
  2928. ^ and computes the sum of the squares of the principal curvatures as,
  2929. ^  2    2  ( g11 l22 + g22 l11 - 2 g12 l12 )^2 - 2 |G| |L|
  2930. ^ k  + k = -----------------------------------------------
  2931. ^  1    2                   |G|^2 ||n||^2
  2932.  See also CCRVTR.
  2933.  Example:
  2934. @\begin{verbatim}
  2935.  cross = cbspline( 3,
  2936.                    list( ctlpt( E2,  0.0,  0.0 ),
  2937.                          ctlpt( E2,  0.8,  0.0 ),
  2938.                          ctlpt( E2,  0.8,  0.2 ),
  2939.                          ctlpt( E2,  0.07, 1.4 ),
  2940.                          ctlpt( E2, -0.07, 1.4 ),
  2941.                          ctlpt( E2, -0.8,  0.2 ),
  2942.                          ctlpt( E2, -0.8,  0.0 ),
  2943.                          ctlpt( E2,  0.0,  0.0 ) ),
  2944.                    list( KV_OPEN ) );
  2945.  cross = coerce( cross, e3 );
  2946.  s = sFromCrvs( list( cross,
  2947.                       cross * trans( vector( 0.5, 0, 1 ) ),
  2948.                       cross * trans( vector( 0, 0, 2 ) ) ), 3 );
  2949.  view( list( s, axes ), on );
  2950.  UCrvtrZXY = scrvtr( s, E3, row );
  2951.  VCrvtrZXY = scrvtr( s, E3, col );
  2952.  UCrvtrXYZ = UCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  2953.  VCrvtrXYZ = VCrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 10 ) );
  2954.  color( UCrvtrXYZ, red );
  2955.  color( VCrvtrXYZ, magenta );
  2956.  view( list( UCrvtrXYZ, VCrvtrXYZ ), off );
  2957.  CrvtrZXY = scrvtr( s, E3, off );
  2958.  CrvtrXYZ = CrvtrZXY * rotx( -90 ) * roty( -90 ) * scale( vector( 1, 1, 0.001 ) );
  2959.  color( CrvtrXYZ, green );
  2960.  view( CrvtrXYZ, off );
  2961. @\end{verbatim}
  2962.  Computes the sqaure of the normal curvature in the U and V direction, flips
  2963.  its scalar value from X to Z using rotations and scale the fields to
  2964.  reasonable values and display them.
  2965.    Then, display a total bound on the normal curvature as well.
  2966.  Due to the large degree of the resulting fields be warned that rational
  2967.  surfaces will compute into large degree curvature bound fields. See also
  2968.  IRITSTATE("InterpProd", FALSE); for faster symbolic computation.
  2969. @See Figure~\ref{fig-scrvtr}.
  2970. @\begin{figure}
  2971. @\vspace{2in}
  2972. @\special{psfile=user_man/scrvtr.ps hscale=100 vscale=100 hoffset=-50 voffset=-170}
  2973. @\caption{From left to right: original surface, normal curvature in the U
  2974. @         direction, normal curvature in the V direction, sum of square of
  2975. @         principle curvatures (different scales).
  2976. @         All computed using SCRVTR.}
  2977. @\label{fig-scrvtr}
  2978. @\end{figure}
  2979. @\subsubsection{SDERIVE}
  2980. !SDERIVE
  2981. @\begin{verbatim}
  2982.  SurfaceType SDERIVE( SurfaceType Srf, NumericType Dir )
  2983. @\end{verbatim}
  2984.    Returns a vector field surface representing the differentiated surface
  2985.  in the given direction (ROW or COL). Evaluation of the returned surface at
  2986.  a given parameter value will return a vector {\em tangent} to {\bf Srf} in
  2987.  {\bf Dir} at that parameter value.
  2988. @\begin{verbatim}
  2989.  DuSrf = SDERIVE( Srf, ROW );
  2990.  DvSrf = SDERIVE( Srf, COL );
  2991.  Normal = coerce( seval( DuSrf, 0.5, 0.5 ), VECTOR_TYPE ) ^
  2992.           coerce( seval( DvSrf, 0.5, 0.5 ), VECTOR_TYPE );
  2993. @\end{verbatim}
  2994.  computes the two partial derivatives of the surface {\bf Srf} and computes
  2995.  its normal as their cross product, at the parametric location (0.5, 0.5).
  2996. @\subsubsection{SDIVIDE}
  2997. !SDIVIDE
  2998. @\begin{verbatim}
  2999.  SurfaceType SDIVIDE( SurfaceType Srf, ConstantType Direction,
  3000.                                                           NumericType Param )
  3001. @\end{verbatim}
  3002.    Subdivides a surface into two at the specified parameter value {\bf Param}
  3003.  in the specified {\bf Direction} (ROW or COL). {\bf Srf} can be either a Bspline
  3004.  surface in which {\bf Param} must be conatined in the parametric domain of the
  3005.  surface, or a Bezier surface in which {\bf Param} must be in the range of zero
  3006.  to one.
  3007.    It returns a list of the two sub-surfaces. The individual surfaces may be
  3008.  extracted from the list using the {\bf NTH} command.
  3009.  Example:
  3010. @\begin{verbatim}
  3011.     SrfLst = SDIVIDE( Srf, ROW, 0.5 );
  3012.     Srf1 = nth( SrfLst, 1 );
  3013.     Srf2 = nth( SrfLst, 2 );
  3014. @\end{verbatim}
  3015.  subdivides {\bf Srf} at the parameter value of 0.5 in the ROW direction.
  3016. @See Figure~\ref{fig-sdivide}.
  3017. @\begin{figure}
  3018. @\vspace{2.9in}
  3019. @\special{psfile=user_man/sdivide.ps hscale=80 vscale=80 hoffset=-20 voffset=-130}
  3020. @\caption{A surface can be subdivided into two distinct regions using SDIVIDE.}
  3021. @\label{fig-sdivide}
  3022. @\end{figure}
  3023. @\subsubsection{SEDITPT}
  3024. !SEDITPT
  3025. @\begin{verbatim}
  3026.  SurfaceType SEDITPT( SurfaceType Srf, CtlPtType CPt, NumericType UIndex,
  3027.                                                       NumericType VIndex )
  3028. @\end{verbatim}
  3029.    Provides a simple mechanism to manually modify a single control point number
  3030.  {\bf UIndex} and {\bf VIndex} (base count is 0) in the control mesh of {\bf Srf}
  3031.  by substituting {\bf CtlPt} instead. CtlPt must have the same point type as
  3032.  the control points of {\bf Srf}. Original surface {\bf Srf} is not modified.
  3033.  Example:
  3034. @\begin{verbatim}
  3035.     CPt = ctlpt( E3, 1, 2, 3 );
  3036.     NewSrf = SEDITPT( Srf, CPt, 0, 0 );
  3037. @\end{verbatim}
  3038.  constructs a {\bf NewSrf} with the first control point of {\bf Srf} being
  3039.  {\bf CPt}.
  3040. @\subsubsection{SEVAL}
  3041. !SEVAL
  3042. @\begin{verbatim}
  3043.  CtlPtType SEVAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  3044. @\end{verbatim}
  3045.    Evaluates the provided surface {\bf Srf} at the given {\bf UParam} and
  3046.  {\bf VParam} values. Both {\bf UParam} and {\bf VParam} should be contained
  3047.  in the surface parametric domain if {\bf Srf} is a Bspline surface, or
  3048.  between zero and one if {\bf Srf} is a Bezier surface. The returned control
  3049.  point has the same type as the control points of {\bf Srf}.
  3050.  Example:
  3051. @\begin{verbatim}
  3052.     CPt = SEVAL( Srf, 0.25, 0.22 );
  3053. @\end{verbatim}
  3054.  evaluates {\bf Srf} at the parameter values of (0.25, 0.22).
  3055. @\subsubsection{SFROMCRVS}
  3056. !SFROMCRVS
  3057. @\begin{verbatim}
  3058.  SurfaceType SFROMCRVS( ListType CrvList, NumericType OtherOrder )
  3059. @\end{verbatim}
  3060.    Constructs a surface by substituting the curves in {\bf CrvList} as rows
  3061.  in a control mesh of a surface. Curves in {\bf CrvList} are made compatible
  3062.  by promoting Bezier curves to Bsplines if necessary, and raising degree
  3063.  and refining as required before substituting the control polygons of the
  3064.  curves as rows in the mesh. The other direction order is set by
  3065.  {\bf OtherOrder}, which cannot be larger than the number of curves.
  3066.    The surface interpolates the first and last curves only.
  3067.  Example:
  3068. @\begin{verbatim}
  3069.     Crv1 = cbspline( 3,
  3070.                      list( ctlpt( E3, 0.0, 0.0, 0.0 ),
  3071.                            ctlpt( E3, 1.0, 0.0, 0.0 ),
  3072.                            ctlpt( E3, 1.0, 1.0, 0.0 ) ),
  3073.                      list( KV_OPEN ) );
  3074.     Crv2 = Crv1 * trans( vector( 0.0, 0.0, 1.0 ) );
  3075.     Crv3 = Crv2 * trans( vector( 0.0, 1.0, 0.0 ) );
  3076.     Srf = SFROMCRVS( list( Crv1, Crv2, Crv3 ), 3 );
  3077. @\end{verbatim}
  3078. @See Figure~\ref{fig-sfromcrvs}.
  3079. @\begin{figure}
  3080. @\vspace{3.2in}
  3081. @\special{psfile=user_man/sfromcrvs.ps hscale=100 vscale=100 hoffset=0 voffset=-85}
  3082. @\caption{A surface can be constructed from a list of curves substituted
  3083. @         as rows into its mesh using SFROMCRVS. The surface does not
  3084. @         necessarily interpolate the curves.}
  3085. @\label{fig-sfromcrvs}
  3086. @\end{figure}
  3087. @\subsubsection{SINTERP}
  3088. !SINTERP
  3089. @\begin{verbatim}
  3090.  SurfaceType SINTERP( ListType PtList, NumericType UOrder, NumericType VOrder,
  3091.                       NumericType USize, NumericType VSize,
  3092.                       ConstantType Param)
  3093. @\end{verbatim}
  3094.    Computes a Bspline polynomial surface that interpolates or approximates
  3095.  the rectangular grid of points in {\bf PtList}. The Bspline surface will
  3096.  have orders {\bf UOrder} and {\bf VOrder} and mesh of size {\bf USize} by
  3097.  {\bf VSize} control points. The knots will be spaced according to
  3098.  {\bf Param} which can be one of PARAM\_UNIFORM, PARAM\_CHORD or
  3099.  PARAM\_CENTRIP. The former prescribed a uniform knot sequence and the
  3100.  latters specified a knot spacing accoridng to the chord length and a square
  3101.  root of the chord length. Currently only PARAM\_UNIFORM is supported.
  3102.    {\bf PtList} is a list of list of points where all lists should carry the
  3103.  same amount of points in them, defining a rectangular grid. All points in
  3104.  {\bf PtList} must be of type (E1-E5, P1-P5) control point, or regular
  3105.  PointType. If {\bf USize} and {\bf VSize} are equal to the number of points
  3106.  in the grid {\bf PtList} the resulting curve will {\em interpolate} the
  3107.  data set. Otherwise, if {\bf USize} or {\bf VSize} is less than the number
  3108.  of points in {\bf PtList} the point data set will be least square
  3109.  approximated. In no time can {\bf USize} or {\bf VSize} be larger that the
  3110.  number of points in {\bf PtList} or lower than {\bf UOrder} and {\bf VOrder},
  3111.  respectively. If {\bf USize} or {\bf VSize} are zero, the grid size
  3112.  is used, forcing an interpolation of the data set.
  3113.    All interior knots will be distinct preserving maximal continuity.
  3114.  The resulting Bspline surface will have open end conditions.
  3115.  Example:
  3116. @\begin{verbatim}
  3117.     pl = nil();
  3118.     pll = nil();
  3119.     for ( x = -5, 1, 5,
  3120.           pl = nil():
  3121.           for ( y = -5, 1, 5,
  3122.                 snoc( point( x, y, sin( x * Pi / 2 ) * cos( y * Pi / 2 ) ),
  3123.                       pl )
  3124.           ):
  3125.           snoc( pl, pll ) );
  3126.     s1 = sinterp( pll, 3, 3, 8, 8, PARAM_UNIFORM );
  3127.     s2 = sinterp( pll, 3, 3, 11, 11, PARAM_UNIFORM );
  3128. @\end{verbatim}
  3129.  Samples an explicit surface sin(x) * cos(y) at a grid of 11 by 11 points,
  3130.  least square fit with a grid of size of 8 by 8 surface {\bf s1}, and
  3131.  interpolate surface {\bf s2} using this data set.
  3132. @See Figure~\ref{fig-sinterp}.
  3133. @\begin{figure}
  3134. @\vspace{1.6in}
  3135. @\special{psfile=user_man/sinterp.ps hscale=95 vscale=95 hoffset=-30 voffset=-130}
  3136. @\caption{A surface least square fitting a data set with insufficient
  3137. @         degrees of freedom (left) and actually interpolating the data
  3138. @         set (right), all using SINTERP.}
  3139. @\label{fig-sinterp}
  3140. @\end{figure}
  3141. @\subsubsection{SMERGE}
  3142. !SMERGE
  3143. @\begin{verbatim}
  3144.  SurfaceType SMERGE( SurfaceType Srf1, SurfaceType Srf2,
  3145.                      NumericType Dir, NumericType SameEdge )
  3146. @\end{verbatim}
  3147.  Merges two surfaces along the requested direction (ROW or COL). If
  3148.  SameEdge is non-zero (ON or TRUE), then the common edge is assumed to be
  3149.  identical and copied only once. Otherwise (OFF or FALSE), a ruled surface
  3150.  is constructed between the two surfaces along the (not) common edge.
  3151.  Example:
  3152. @\begin{verbatim}
  3153.  MergedSrf = SMERGE( Srf1, Srf2, ROW, TRUE );
  3154. @\end{verbatim}
  3155. @\subsubsection{SMORPH}
  3156. !SMORPH
  3157. @\begin{verbatim}
  3158.  SurfaceType SMORPH( SurfaceType Srf1, SurfaceType Srf2, NumericType Blend )
  3159. @\end{verbatim}
  3160.  Creates a new surface which is a {\em convex blend} of the two given surfaces.
  3161.  The two given surfaces must be compatible (see FFCOMPAT) before this blend
  3162.  is invoked. Very useful if a sequence that "morphs" one surface to another
  3163.  is to be created.
  3164.  Example:
  3165. @\begin{verbatim}
  3166.  for ( i = 0.0, 1.0, 11.0,
  3167.         Msrf = SMORPH( Srf1, Srf2, i / 11.0 ):
  3168.         color( Msrf, white ):
  3169.         attrib( Msrf, "rgb", "255,255,255" ):
  3170.         attrib( Msrf, "reflect", "0.7" ):
  3171.         save( "morp1-" + i, Msrf )
  3172. @\end{verbatim}
  3173.  creates a sequence of 12 surfaces, morphed from {\bf Srf1} to {\bf Srf2}
  3174.  and saves them in the files "morph-0.dat" to "morph-11.dat".
  3175.  See also CMORPH.
  3176. @See Figure~\ref{fig-smorph}.
  3177. @\begin{figure}
  3178. @\vspace{1.2in}
  3179. @\special{psfile=user_man/smorph.ps hscale=100 vscale=100 hoffset=-50 voffset=-150}
  3180. @\caption{A morphing sequence between a bottle and a glass. Snapshots computed
  3181. @        using SMORPH.}
  3182. @\label{fig-smorph}
  3183. @\end{figure}
  3184. @\subsubsection{SNORMAL}
  3185. !SNORMAL
  3186. @\begin{verbatim}
  3187.  VectorType SNORMAL( SurfaceType Srf, NumericType UParam, NumericType VParam )
  3188. @\end{verbatim}
  3189.    Computes the normal vector to {\bf Srf} at the parameter values {\bf UParam}
  3190.  and {\bf VParam}. The returned vector has a unit length.
  3191.  Example:
  3192. @\begin{verbatim}
  3193.     Normal = SNORMAL( Srf, 0.5, 0.5 );
  3194. @\end{verbatim}
  3195.  computes the normal to {\bf Srf} at the parameter values (0.5, 0.5).
  3196.  See also SNRMLSRF.
  3197. @\subsubsection{SNRMLSRF}
  3198. !SNRMLSRF
  3199. @\begin{verbatim}
  3200.  SurfaceType SNRMLSRF( SurfaceType Srf )
  3201. @\end{verbatim}
  3202.  Symbolically computes a vector field surface representing the non-normalized
  3203.  normals of the given surface. That is the normal surface, evaluated at
  3204.  $(u, v)$, provides a vector in the direction of the normal of the original
  3205.  surface at $(u, v)$. The normal surface is computed as the symbolic cross
  3206.  product of the two surfaces representing the partial derivatives of the
  3207.  original surface.
  3208.  Example:
  3209. @\begin{verbatim}
  3210.  NrmlSrf = SNRMLSRF( Srf );
  3211. @\end{verbatim}
  3212. @See Figure~\ref{fig-snrmlsrf}.
  3213. @\begin{figure}
  3214. @\vspace{2.7in}
  3215. @\special{psfile=user_man/snrmlsrf.ps hscale=80 vscale=80 hoffset=10 voffset=-140}
  3216. @\caption{A vector field normal (right) computed for a unit sphere using SNRMLSRF.
  3217. @        The normal field degenerates at the norph and south poles because the
  3218. @        surface is not regular there.}
  3219. @\label{fig-snrmlsrf}
  3220. @\end{figure}
  3221. @\subsubsection{SPHERE}
  3222. !SPHERE
  3223. @\begin{verbatim}
  3224.  PolygonType SPHERE( VectorType Center, NumericType Radius )
  3225. @\end{verbatim}
  3226.    Creates a SPHERE geometric object, defined by {\bf Center} as the center of
  3227.  the SPHERE, and with {\bf Radius} as the radius of the SPHERE.
  3228.    See RESOLUTION for accuracy of SPHERE approximation as a polygonal model. 
  3229. @\subsubsection{SRAISE}
  3230. !SRAISE
  3231. @\begin{verbatim}
  3232.  SurfaceType SRAISE( SurfaceType Srf, ConstantType Direction,
  3233.                                                       NumericType NewOrder )
  3234. @\end{verbatim}
  3235.    Raises {\bf Srf} to the specified {\bf NewOrder} in the specified
  3236.  {\bf Direction}.
  3237.  Example:
  3238. @\begin{verbatim}
  3239.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.0 ),
  3240.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  3241.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  3242.                                    ctlpt( E3,  0.5,  0.5, 0.0 ) ) ) );
  3243.     Srf = SRAISE( SRAISE( Srf, ROW, 3 ), COL, 3 );
  3244. @\end{verbatim}
  3245.  constructs a bilinear flat ruled surface and raises both its directions to be
  3246.  a bi-quadratic surface.
  3247. @\subsubsection{SREFINE}
  3248. !SREFINE
  3249. @\begin{verbatim}
  3250.  SurfaceType SREFINE( SurfaceType Srf, ConstantType Direction,
  3251.                       NumericType Replace, ListType KnotList )
  3252. @\end{verbatim}
  3253.    Provides the ability to {\bf Replace} a knot vector of {\bf Srf} or refine 
  3254.  it in the specified direction {\bf Direction} (ROW or COL).
  3255.    {\bf KnotList} is a list of knots to refine {\bf Srf} at. All knots should be
  3256.  contained in the parametric domain of {\bf Srf} in {\bf Direction}. If the knot
  3257.  vector is replaced, the length of {\bf KnotList} should be identical to the
  3258.  length of the original knot vector of {\bf Srf} in {\bf Direction}. If {\bf Srf}
  3259.  is a Bezier surface, it is automatically promoted to be a Bspline surface.
  3260.  Example:
  3261. @\begin{verbatim}
  3262.     Srf = SREFINE( SREFINE( Srf,
  3263.                             ROW, FALSE, list( 0.333, 0.667 ) ),
  3264.                    COL, FALSE, list( 0.333, 0.667 ) );
  3265. @\end{verbatim}
  3266.  refines {\bf Srf} in both directions by adding two more knots at 0.333 and
  3267.  0.667.
  3268. @\subsubsection{SREGION}
  3269. !SREGION
  3270. @\begin{verbatim}
  3271.  SurfaceType SREGION( SurfaceType Srf, ConstantType Direction,
  3272.                                   NumericType MinParam, NumericType MaxParam )
  3273. @\end{verbatim}
  3274.    Extracts a region of {\bf Srf} between {\bf MinParam} and {\bf MaxParam}
  3275.  in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
  3276.  should be contained in the parametric domain of {\bf Srf} in {\bf Direction}.
  3277.  Example:
  3278. @\begin{verbatim}
  3279.     Srf = ruledSrf( cbezier( list( ctlpt( E3, -0.5, -0.5, 0.5 ),
  3280.                                    ctlpt( E3,  0.0,  0.5, 0.0 ),
  3281.                                    ctlpt( E3,  0.5, -0.5, 0.0 ) ) ),
  3282.                     cbezier( list( ctlpt( E3, -0.5,  0.5, 0.0 ),
  3283.                                    ctlpt( E3,  0.0,  0.0, 0.0 ),
  3284.                                    ctlpt( E3,  0.5,  0.5, 0.5 ) ) ) );
  3285.     SubSrf = SREGION( Srf, ROW, 0.3, 0.6 );
  3286. @\end{verbatim}
  3287.  extracts the region of {\bf Srf} from the parameter value 0.3 to the
  3288.  parameter value 0.6 along the ROW direction. the COLumn direction is
  3289.  extracted as a whole.
  3290. @See Figure~\ref{fig-sregion}.
  3291. @\begin{figure}
  3292. @\vspace{2.2in}
  3293. @\special{psfile=user_man/sregion.ps hscale=100 vscale=100 hoffset=-40 voffset=-190}
  3294. @\caption{A region can be extracted from a freeform surface using SREGION.}
  3295. @\label{fig-sregion}
  3296. @\end{figure}
  3297. @\subsubsection{SREPARAM}
  3298. !SREPARAM
  3299. @\begin{verbatim}
  3300.  SurfaceType SREPARAM( SurfaceType Srf, ConstantType Direction,
  3301.                                   NumericType MinParam, NumericType MaxParam )
  3302. @\end{verbatim}
  3303.    Reparametrize {\bf Srf} over a new domain from {\bf MinParam} to {\bf MaxParam},
  3304.  in the prescribed {\bf Direction}. This operation does not affect the geometry
  3305.  of the surface and only affine transforms its knot vectors. A Bezier surface
  3306.  will automatically be promoted into a Bspline surface by this function.
  3307.  Example:
  3308. @\begin{verbatim}
  3309.     srf = sbspline( 2, 4,
  3310.                      list( list( ctlpt( E3, 0.0, 0.0, 1.0 ),
  3311.                                  ctlpt( E2, 0.0, 1.0 ),
  3312.                                  ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3313.                            list( ctlpt( E2, 1.0, 0.0 ),
  3314.                                  ctlpt( E3, 1.0, 1.0, 2.0 ),
  3315.                                  ctlpt( E2, 1.0, 2.0 ) ),
  3316.                            list( ctlpt( E3, 2.0, 0.0, 2.0 ),
  3317.                                  ctlpt( E2, 2.0, 1.0 ),
  3318.                                  ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3319.                            list( ctlpt( E2, 3.0, 0.0 ),
  3320.                                  ctlpt( E3, 3.0, 1.0, 2.0 ),
  3321.                                  ctlpt( E2, 3.0, 2.0 ) ),
  3322.                            list( ctlpt( E3, 4.0, 0.0, 1.0 ),
  3323.                                  ctlpt( E2, 4.0, 1.0 ),
  3324.                                  ctlpt( E3, 4.0, 2.0, 1.0 ) ) ),
  3325.                      list( list( KV_OPEN ),
  3326.                            list( KV_OPEN ) ) );
  3327.     srf = sreparam( sreparam( srf, ROW, 0, 1 ), COL, 0, 1 );
  3328. @\end{verbatim}
  3329.  Ensures that the Bspline surface is defined over the unit size parametric
  3330.  domain.
  3331. @\subsubsection{STANGENT}
  3332. !STANGENT
  3333. @\begin{verbatim}
  3334.  VectorType STANGENT( SurfaceType Srf, ConstantType Direction,
  3335.                       NumericType UParam, NumericType VParam )
  3336. @\end{verbatim}
  3337.    Computes the tangent vector to {\bf Srf} at the parameter values {\bf UParam}
  3338.  and {\bf VParam} in {\bf Direction}. The returned vector has a unit length.
  3339.  Example:
  3340. @\begin{verbatim}
  3341.     Tang = STANGENT( Srf, ROW, 0.5, 0.6 );
  3342. @\end{verbatim}
  3343.  computes the tangent to {\bf Srf} in the ROW direction at the parameter
  3344.  values (0.5, 0.6).
  3345. @\subsubsection{STRIMSRF}
  3346. !STRIMSRF
  3347. @\begin{verbatim}
  3348.  SurfaceType STRIMSRF( TrimSrfType TSrf )
  3349. @\end{verbatim}
  3350.    Extracts the surface of a trimmed surface {\bf TSrf}.
  3351.  Example:
  3352. @\begin{verbatim}
  3353.     Srf = STRIMSRF( TrimSrf ); 
  3354. @\end{verbatim}
  3355.  extracts the surface of {\bf TrimSrf}.
  3356. @\subsubsection{STRIVAR}
  3357. !STRIVAR
  3358. @\begin{verbatim}
  3359.  SurfaceType STRIVAR( TrivarType TV )
  3360. @\end{verbatim}
  3361.    Extracts an iso surface from a trivariate function {\bf TV}.
  3362.  Example:
  3363. @\begin{verbatim}
  3364.     TV1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  3365.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  3366.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  3367.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  3368.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  3369.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  3370.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  3371.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  3372.     Srf = STRIVAR( TV1, col, 0.4 ); 
  3373. @\end{verbatim}
  3374.  extracts an iso surface of {\bf TV1}, in the {\bf col} direction at
  3375.  parameter value 0.4.
  3376. @See Figure~\ref{fig-strivar}.
  3377. @\begin{figure}
  3378. @\vspace{2.5in}
  3379. @\special{psfile=user_man/strivar.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
  3380. @\caption{Extracts an iso bilinear surface from a trilinear function,
  3381. @    using STRIVAR.}
  3382. @\label{fig-strivar}
  3383. @\end{figure}
  3384. @\subsubsection{SURFPREV}
  3385. !SURFPREV
  3386. @\begin{verbatim}
  3387.  SurfaceType SURFPREV( CurveType Object )
  3388. @\end{verbatim}
  3389.  Same as SURFREV but approximates the surface of revolution as a
  3390.  {\em polynomial} surface. Object must be a polynomial curve.
  3391.  See SURFREV.
  3392. @\subsubsection{SURFREV}
  3393. !SURFREV
  3394. @\begin{verbatim}
  3395.  PolygonType SURFREV( PolygonType Object )
  3396.  SurfaceType SURFREV( CurveType Object )
  3397. @\end{verbatim}
  3398.    Creates a surface of revolution by rotating the first polygon/curve of the
  3399.  given {\bf Object}, around the Z axis. Use the linear transformation function
  3400.  to position a surface of revolution in a different orientation.
  3401.  Example:
  3402. @\begin{verbatim}
  3403.     VTailAntn = SURFREV( ctlpt( E3, 0.001, 0.0, 1.0 ) +
  3404.                          ctlpt( E3, 0.01,  0.0, 1.0 ) +
  3405.                          ctlpt( E3, 0.01,  0.0, 0.8 ) +
  3406.                          ctlpt( E3, 0.03,  0.0, 0.7 ) +
  3407.                          ctlpt( E3, 0.03,  0.0, 0.3 ) +
  3408.                          ctlpt( E3, 0.001, 0.0, 0.0 ) );
  3409. @\end{verbatim}
  3410.  constructs a piecewise linear Bspline curve in the XZ plane and uses it to
  3411.  construct a surface of revolution by rotating it around the Z axis.
  3412.    See also SURFPREV.
  3413. @See Figure~\ref{fig-surfrev}.
  3414. @\begin{figure}
  3415. @\vspace{2.4in}
  3416. @\special{psfile=user_man/surfrev.ps hscale=100 vscale=100 hoffset=-60 voffset=-140}
  3417. @\caption{A surface of revolution, VTailAntn in surfrev documentation, can be
  3418. @        constructed using SURFREV or SURFPREV.}
  3419. @\label{fig-surfrev}
  3420. @\end{figure}
  3421. @\subsubsection{SWEEPSRF}
  3422. !SWEEPSRF
  3423. @\begin{verbatim}
  3424.  SurfaceType SWEEPSRF( CurveType CrossSection, CurveType Axis,
  3425.                      CurveType FrameCrv | VectorType FrameVec | ConstType OFF )
  3426. @\end{verbatim}
  3427.    Constructs a generalized cylinder surface. This function sweeps a specified
  3428.  cross-section {\bf CrossSection} along the provided {\bf Axis}.
  3429.    By default, when frame specification is {\bf OFF}, the orientation
  3430.  of the cross section is computed using the {\bf Axis} curve tangent and
  3431.  normal. However, unlike the Frenet frame, attempt is made to minimize
  3432.  the normal change, as can happen along inflection points in {\bf Axis}.
  3433.    If a VectorType {\bf FrameVec} is provided as a frame orientation setting,
  3434.  it is used to fix the binormal direction to this value. In other words, the
  3435.  orientation frame has a fixed binormal. If a CurveType {\bf FrameCrv} is
  3436.  specified as a frame orientation setting, this vector field curve is
  3437.  evaluated at each placement of the cross-section to yield the needed binormal.
  3438.    The resulting sweep is only an approximation of the real sweep. The
  3439.  resulting sweep surface will not be exact, in general.
  3440.    Refinement of the axis curve at the proper location, where accuracy is
  3441.  important, should improve the accuracy of the output. The parametric domains
  3442.  of {\bf FrameCrv} do not have to match the parametric domain of {\bf Axis},
  3443.  and its parametric domain is automatically made compatible by this function.
  3444.  Example:
  3445. @\begin{verbatim}
  3446.     Cross = arc( vector( 0.2, 0.0, 0.0 ),
  3447.                  vector( 0.2, 0.2, 0.0 ),
  3448.                  vector( 0.0, 0.2, 0.0 ) ) +
  3449.             arc( vector( 0.0, 0.4, 0.0 ),
  3450.                  vector( 0.1, 0.4, 0.0 ),
  3451.                  vector( 0.1, 0.5, 0.0 ) ) +
  3452.             arc( vector( 0.8, 0.5, 0.0 ),
  3453.                  vector( 0.8, 0.3, 0.0 ),
  3454.                  vector( 1.0, 0.3, 0.0 ) ) +
  3455.             arc( vector( 1.0, 0.1, 0.0 ),
  3456.                  vector( 0.9, 0.1, 0.0 ),
  3457.                  vector( 0.9, 0.0, 0.0 ) ) +
  3458.             ctlpt( E2, 0.2, 0.0 );
  3459.     Axis = arc( vector( -1.0, 0.0, 0.0 ),
  3460.                 vector(  0.0, 0.0, 0.1 ),
  3461.                 vector(  1.0, 0.0, 0.0 ) );
  3462.     Axis = crefine( Axis, FALSE, list( 0.25, 0.5, 0.75 ) );
  3463.     Srf1 = SWEEPSRF( Cross, Axis, OFF );
  3464.     Srf2 = SWEEPSRF( Cross, Axis, vector( 0.0, 1.0, 1.0 ) );
  3465.     Srf3 = SWEEPSRF( Cross, Axis,
  3466.                      cbezier( list( ctlpt( E3,  1.0, 0.0, 0.0 ),
  3467.                                     ctlpt( E3,  0.0, 1.0, 0.0 ),
  3468.                                     ctlpt( E3, -1.0, 0.0, 0.0 ) ) ) );
  3469. @\end{verbatim}
  3470.  constructs a rounded rectangle cross-section and sweeps it along an arc,
  3471.  while orienting it several ways. The axis curve {\bf Axis} is manually
  3472.  refined to better approximate the requested shape.
  3473.  See also SWPSCLSRF for sweep with scale.
  3474. @See Figure~\ref{fig-sweepsrf}.
  3475. @\begin{figure}
  3476. @\vspace{1.4in}
  3477. @\special{psfile=user_man/sweepsrf.ps hscale=100 vscale=100 hoffset=-30 voffset=-210}
  3478. @\caption{Three examples of the use of SWEEPSRF (Srf1, Srf2, Srf3 from left to right
  3479. @        in sweepsrf documentation).}
  3480. @\label{fig-sweepsrf}
  3481. @\end{figure}
  3482. @\subsubsection{SWPSCLSRF}
  3483. !SWPSCLSRF
  3484. @\begin{verbatim}
  3485.  SurfaceType SWPSCLSRF( CurveType CrossSection, CurveType Axis,
  3486.                         NumericType Scale | CurveType ScaleCrv,
  3487.                         CurveType FrameCrv | VectorType FrameVec
  3488.                                                           | ConstType OFF,
  3489.                         NumericType ScaleRefine )
  3490. @\end{verbatim}
  3491.    Constructs a generalized cylinder surface. This function sweeps a specified
  3492.  cross-section {\bf CrossSection} along the provided {\bf Axis}.
  3493.  The cross-section may be scaled by a constant value {\bf Scale}, or scaled
  3494.  along the {\bf Axis} parametric direction via a scaling curve {\bf ScaleCrv}.
  3495.    By default, when frame specification is {\bf OFF}, the orientation
  3496.  of the cross section is computed using the {\bf Axis} curve tangent and
  3497.  normal. However, unlike the Frenet frame, attempt is made to minimize
  3498.  the normal change, as can happen along inflection points in {\bf Axis}.
  3499.    If a VectorType {\bf FrameVec} is provided as a frame orientation setting,
  3500.  it is used to fix the binormal direction to this value. In other words, the
  3501.  orientation frame has a fixed binormal. If a CurveType {\bf FrameCrv} is
  3502.  specified as a frame orientation setting, this vector field curve is
  3503.  evaluated at each placement of the cross-section to yield the needed binormal.
  3504.    {\bf ScaleRefine} is an integer value to define possible refinement of the
  3505.  {\bf Axis} to reflect the information in {\bf ScalingCrv}. Value of zero will
  3506.  force no refinement while value of $n > 0$ will insert $n$ times the
  3507.  number of control points in {\bf ScaleCrv} into {\bf Axis}, better emulating
  3508.  the scaling requested.
  3509.    The resulting sweep is only an approximation of the real sweep. The
  3510.  scaling and axis placement will not be exact, in general.
  3511.    Manual refinement (in addition to {\bf ScaleRefine}) of the axis curve at
  3512.  the proper location, where accuracy is important, should improve the accuracy
  3513.  of the output. The parametric domains of {\bf ScaleCrv} and {\bf FrameCrv} do
  3514.  not have to match the parametric domain of {\bf Axis}, and their domains are
  3515.  made compatible by this function.
  3516.  Example:
  3517. @\begin{verbatim}
  3518.     Cross = arc( vector( -0.11, -0.01, 0.0 ),
  3519.                  vector( -0.1,  -0.1,  0.0 ),
  3520.                  vector( -0.1,  -0.11, 0.0 ) ) +
  3521.             arc( vector(  0.1,  -0.11, 0.0 ),
  3522.                  vector(  0.1,  -0.1,  0.0 ),
  3523.                  vector(  0.11, -0.1,  0.0 ) ) +
  3524.             arc( vector(  0.11,  0.1,  0.0 ),
  3525.                  vector(  0.1,   0.1,  0.0 ),
  3526.                  vector(  0.1,   0.11, 0.0 ) ) +
  3527.             arc( vector( -0.1,   0.11, 0.0 ),
  3528.                  vector( -0.1,   0.1,  0.0 ),
  3529.                  vector( -0.11,  0.1,  0.0 ) ) +
  3530.             ctlpt( E2, -0.11, -0.1 );
  3531.     scaleCrv = cbspline( 3,
  3532.                          list( ctlpt( E2, 0.05, 1.0 ),
  3533.                                ctlpt( E2, 0.1,  0.0 ),
  3534.                                ctlpt( E2, 0.2,  2.0 ),
  3535.                                ctlpt( E2, 0.3,  0.0 ),
  3536.                                ctlpt( E2, 0.4,  2.0 ),
  3537.                                ctlpt( E2, 0.5,  0.0 ),
  3538.                                ctlpt( E2, 0.6,  2.0 ),
  3539.                                ctlpt( E2, 0.7,  0.0 ),
  3540.                                ctlpt( E2, 0.8,  2.0 ),
  3541.                                ctlpt( E2, 0.85, 1.0 ) ),
  3542.                          list( KV_OPEN ) );
  3543.     Axis = circle( vector( 0, 0, 0 ), 1 );
  3544.     Frame = circle( vector( 0, 0, 0 ), 1 )
  3545.             * rotx( 90 ) * trans( vector( 1.5, 0.0, 0.0 ) );
  3546.     Srf1 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 0 );
  3547.     Srf2 = SWPSCLSRF( Cross, Axis, scaleCrv, off, 2 );
  3548.     Srf3 = SWPSCLSRF( Cross, Axis, 1.0, Frame, 0 );
  3549. @\end{verbatim}
  3550.  constructs a rounded rectangle cross-section and sweeps it along a circle,
  3551.  while scaling and orienting in several ways. The axis curve {\bf Axis} is
  3552.  automatically refined in {\bf Srf2} to better approximate the requested
  3553.  scaling.
  3554.  See also SWEEPSRF for sweep with no scale.
  3555. @See Figure~\ref{fig-swpsclsrf}.
  3556. @\begin{figure}
  3557. @\vspace{1.2in}
  3558. @\special{psfile=user_man/swpsclsrf.ps hscale=100 vscale=100 hoffset=-35 voffset=-170}
  3559. @\caption{Three examples of the use of SWPSCLSRF (Srf1, Srf2, Srf3 from left to right
  3560. @        in swpsclsrf documentation).}
  3561. @\label{fig-swpsclsrf}
  3562. @\end{figure}
  3563. @\subsubsection{SYMBPROD}
  3564. !SYMBPROD
  3565. @\begin{verbatim}
  3566.  CurveType SYMBPROD( CurveType Crv1, CurveType Crv2 )
  3567.  SurfaceType SYMBPROD( SurfaceType Srf1, SurfaceType Srf2 )
  3568. @\end{verbatim}
  3569.  Computes the symbolic product of the given two curves or surfaces as
  3570.  a curve or surface. The product is computed coordinate-wise.
  3571.  Example:
  3572. @\begin{verbatim}
  3573.  ProdSrf = SYMBPROD( Srf1, Srf2 )
  3574. @\end{verbatim}
  3575. @\subsubsection{SYMBDPROD}
  3576. !SYMBDPROD
  3577. @\begin{verbatim}
  3578.  CurveType SYMBDPROD( CurveType Crv1, CurveType Crv2 )
  3579.  SurfaceType SYMBDPROD( SurfaceType Srf1, SurfaceType Srf2 )
  3580. @\end{verbatim}
  3581.  Computes the symbolic dot (inner) product of the given two curves or surfaces
  3582.  as a {\em scalar} curve or surface.
  3583.  Example:
  3584. @\begin{verbatim}
  3585.  DiffCrv = symbdiff( Crv1, Crv2 )
  3586.  DistSqrCrv = SYMBDPROD( DiffCrv, DiffCrv )
  3587. @\end{verbatim}
  3588.  Computes a scalar curve that at parameter $t$ is equal to the distance
  3589.  square between Crv1 at $t$ and Crv2.
  3590. @\subsubsection{SYMBCPROD}
  3591. !SYMBCPROD
  3592. @\begin{verbatim}
  3593.  CurveType SYMBCPROD( CurveType Crv1, CurveType Crv2 )
  3594.  SurfaceType SYMBCPROD( SurfaceType Srf1, SurfaceType Srf2 )
  3595. @\end{verbatim}
  3596.  Computes the symbolic cross product of the given two curves or surfaces as
  3597.  a curve or surface.
  3598.  Example:
  3599. @\begin{verbatim}
  3600.  NrmlSrf = SYMBCPROD( sderive( Srf, ROW ), sderive( Srf, COL ) )
  3601. @\end{verbatim}
  3602.  computes a normal surface as the cross product of the surface two partial
  3603.  derivatives (see SNRMLSRF).
  3604. @\subsubsection{SYMBSUM}
  3605. !SYMBSUM
  3606. @\begin{verbatim}
  3607.  CurveType SYMBSUM( CurveType Crv1, CurveType Crv2 )
  3608.  SurfaceType SYMBSUM( SurfaceType Srf1, SurfaceType Srf2 )
  3609. @\end{verbatim}
  3610.  Computes the symbolic sum of the given two curves or surfaces as
  3611.  a curve or surface. The sum is computed coordinate-wise.
  3612.  Example:
  3613. @\begin{verbatim}
  3614.  SumCrv = SYMBSUM( Crv1, Crv2 )
  3615. @\end{verbatim}
  3616. @\subsubsection{SYMBDIFF}
  3617. !SYMBDIFF
  3618. @\begin{verbatim}
  3619.  CurveType SYMBDIFF( CurveType Crv1, CurveType Crv2 )
  3620.  SurfaceType SYMBDIFF( SurfaceType Srf1, SurfaceType Srf2 )
  3621. @\end{verbatim}
  3622.  Computes the symbolic difference of the given two curves or surfaces as
  3623.  a curve or surface. The difference is computed coordinate-wise.
  3624.  Example:
  3625. @\begin{verbatim}
  3626.  DiffCrv = SYMBDIFF( Crv1, Crv2 )
  3627.  DistSqrCrv = symbdprod( DiffCrv, DiffCrv )
  3628. @\end{verbatim}
  3629. @\subsubsection{TBEZIER}
  3630. !TBEZIER
  3631. @\begin{verbatim}
  3632.  TrivarType TBEZIER( ListType CtlMesh )
  3633. @\end{verbatim}
  3634.    Creates a Bezier trivariate using the provided control mesh. {\bf CtlMesh}
  3635.  is a list of planes, each of which is a list of rows, each of which is a list
  3636.  of control points. All control points must be of type (E1-E5, P1-P5), or
  3637.  regular PointType defining the trivariate's control mesh. Surface's point
  3638.  type will be of a space which is the union of the spaces of all points.
  3639. @The created trivariate is the piecewise polynomial (or rational) function,
  3640. @\begin{equation}
  3641. @     T(u, v, w) = \sum_{i=0}^m \sum_{j=0}^n \sum_{k=0}^l
  3642. @                        P_{ijk} B_i(u) B_j(v) B_k(w)
  3643. @\end{equation}
  3644. @where $P_{ijk}$ are the control points {\bf CtlMesh}. and $l$, $m$ and $n$
  3645. @are the degrees of the trivariate, which are one less than the number of
  3646. @points in the appropriate direction.
  3647.  Example:
  3648. @\begin{verbatim}
  3649.    TV = TBEZIER( list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  3650.                                    ctlpt( E3, 0.2, 0.5, 1.1 ),
  3651.                                    ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  3652.                              list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  3653.                                    ctlpt( E3, 0.5, 1.7, 1.7 ),
  3654.                                    ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  3655.                              list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  3656.                                    ctlpt( E3, 0.8, 2.6, 1.4 ),
  3657.                                    ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  3658.                        list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  3659.                                    ctlpt( E3, 1.3, 0.2, 1.7 ),
  3660.                                    ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  3661.                              list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  3662.                                    ctlpt( E3, 1.9, 1.4, 1.2 ),
  3663.                                    ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  3664.                              list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  3665.                                    ctlpt( E3, 1.6, 2.5, 1.7 ),
  3666.                                    ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ) );
  3667. @\end{verbatim}
  3668.  creats a trivariate Bezier which is linear in the first direction, and
  3669.  quadratic in the second and third.
  3670. @See Figure~\ref{fig-tbezier}.
  3671. @\begin{figure}
  3672. @\vspace{3.2in}
  3673. @\special{psfile=user_man/tbezier.ps hscale=100 vscale=100 hoffset=-60 voffset=-100}
  3674. @\caption{A trivariate Bezier of degree 2 by 3 by 3 (left) and a trilinear
  3675. @     Bspline (right). Both share the same control mesh.}
  3676. @\label{fig-tbezier}
  3677. @\end{figure}
  3678. @\subsubsection{TBSPLINE}
  3679. !TBSPLINE
  3680. @\begin{verbatim}
  3681.  TrivarType TBSPLINE( NumericType UOrder,
  3682.                       NumericType VOrder,
  3683.                       NumericType WOrder,
  3684.                       ListType CtlMesh,
  3685.                       ListType KnotVectors )
  3686. @\end{verbatim}
  3687.    Creates a Bspline trivariate with the provided {\bf UOrder}, {\bf VOrder}
  3688.  and {\bf WOrder} orders, the control mesh {\bf CtlMesh}, and the three knot
  3689.  vectors in {\bf KnotVectors}.
  3690.    {\bf CtlMesh} is a list of planes, each of which is a list of rows, each
  3691.  of which is a list of control points. All control points must be of point
  3692.  type (E1-E5, P1-P5), or regular PointType defining the trivariate's control
  3693.  mesh. Trivariate's point type will be of a space which is the union of the
  3694.  spaces of all points.
  3695.    {\bf KnotVectors} is a list of three knot vectors. Each knot vector is a
  3696.  list of NumericType knots of length {\bf \#CtlPtList} plus the {\bf Order}.
  3697.  If, however, the length of the knot vector is equal to {\bf \#CtlPtList +
  3698.  Order + Order - 1} the curve is assumed {\em periodic.} 
  3699.    The knot vector may also be a list of a single constant KV\_OPEN or
  3700.  KV\_FLOAT or KV\_PERIODIC, in which a uniform knot vector with the
  3701.  appropriate length and with open, floating or periodic end condition
  3702.  will be constructed automatically.
  3703. @The created surface is the piecewise polynomial (or rational) surface,
  3704. @\begin{equation}
  3705. @     T(u, v, w) = \sum_{i=0}^m \sum_{j=0}^n \sum_{k=0}^l P_{ijk}
  3706. @                               B_{i,\chi}(u) B_{j,\xi}(v) B_{k,\phi}(w)
  3707. @\end{equation}
  3708. @where $P_{ijk}$ are the control points {\bf CtlMesh}, and $l$, $m$ and $n$
  3709. @are the degrees of the surface, which are one less than {\bf UOrder},
  3710. @{\bf VOrder} and {\bf WOrder} and $\chi$, $\xi$ and $\phi$ are the three
  3711. @knot vectors of the trivariate.
  3712.  Example:
  3713. @\begin{verbatim}
  3714.    TV = TBSPLINE( 2, 2, 2,
  3715.                   list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  3716.                                     ctlpt( E3, 0.2, 0.5, 1.1 ),
  3717.                                     ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  3718.                               list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  3719.                                     ctlpt( E3, 0.5, 1.7, 1.7 ),
  3720.                                     ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  3721.                               list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  3722.                                     ctlpt( E3, 0.8, 2.6, 1.4 ),
  3723.                                     ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  3724.                         list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  3725.                                     ctlpt( E3, 1.3, 0.2, 1.7 ),
  3726.                                     ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  3727.                               list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  3728.                                     ctlpt( E3, 1.9, 1.4, 1.2 ),
  3729.                                     ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  3730.                               list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  3731.                                     ctlpt( E3, 1.6, 2.5, 1.7 ),
  3732.                                     ctlpt( E3, 1.8, 2.7, 2.5 ) ) ) ),
  3733.                   list( list( KV_OPEN ),
  3734.                         list( KV_OPEN ),
  3735.                         list( KV_OPEN ) ) );
  3736. @\end{verbatim}
  3737.  constructs a trilinear Bspline trivariate with open end conditions.
  3738. @See Figure~\ref{fig-tbezier}.
  3739. @\subsubsection{TDERIVE}
  3740. !TDERIVE
  3741. @\begin{verbatim}
  3742.  TrivarType TDERIVE( TrivarType TV, NumericType Dir )
  3743. @\end{verbatim}
  3744.    Returns a vector field trivariate representing the differentiated 
  3745.  trivariate in the given direction (ROW, COL, or DEPTH). Evaluation of the
  3746.  returned trivariate at a given parameter value will return a vector
  3747.  representing the partial derivative of {\bf TV} in {\bf Dir} at that
  3748.  parameter value.
  3749. @\begin{verbatim}
  3750.  TV = tbezier( list( list( list( ctlpt( E1, 0.1 ),
  3751.                                  ctlpt( E1, 0.2 ) ),
  3752.                            list( ctlpt( E1, 0.3 ),
  3753.                                  ctlpt( E1, 0.4 ) ) ),
  3754.                      list( list( ctlpt( E1, 2.4 ),
  3755.                                  ctlpt( E1, 2.2 ) ),
  3756.                            list( ctlpt( E1, 2.3 ),
  3757.                                  ctlpt( E1, 2.1 ) ) ) ) );
  3758.  DuTV = TDERIVE( TV, ROW );
  3759.  DvTV = TDERIVE( TV, COL );
  3760.  DwTV = TDERIVE( TV, DEPTH );
  3761. @\end{verbatim}
  3762.  computes the gradiate of a scalar trivariate field, by computing its
  3763.  partials with respect to u, v, and w.
  3764. @\subsubsection{TDIVIDE}
  3765. !TDIVIDE
  3766. @\begin{verbatim}
  3767.  TrivarType TDIVIDE( TrivarType TV, ConstantType Direction,
  3768.                                                           NumericType Param )
  3769. @\end{verbatim}
  3770.    Subdivides a trivariate into two at the specified parameter value {\bf Param}
  3771.  in the specified {\bf Direction} (ROW, COL, or DEPTH). {\bf TV} can be either
  3772.  a Bspline trivairate in which {\bf Param} must be conatined in the parametric
  3773.  domain of the trivariate, or a Bezier trivariate in which {\bf Param} must be
  3774.  in the range of zero to one.
  3775.    It returns a list of the two sub-trivariates. The individual trivariates
  3776.  may be extracted from the list using the {\bf NTH} command.
  3777.  Example:
  3778. @\begin{verbatim}
  3779.     TvDiv = TDIVIDE( Tv2, depth, 0.3 );
  3780.     Tv2a = nth( TvDiv, 1 ) * tx( -2.2 );
  3781.     Tv2b = nth( TvDiv, 2 ) * tx( 2.0 );
  3782. @\end{verbatim}
  3783.  subdivides {\bf Tv2} at the parameter value of 0.3 in the DEPTH direction,
  3784. @See Figure~\ref{fig-tdivide}.
  3785. @\begin{figure}
  3786. @\vspace{2.6in}
  3787. @\special{psfile=user_man/tdivide.ps hscale=110 vscale=110 hoffset=-60 voffset=-135}
  3788. @\caption{A trivariate can be subdivided into two distinct regions using TDIVIDE.}
  3789. @\label{fig-tdivide}
  3790. @\end{figure}
  3791. @\subsubsection{TEVAL}
  3792. !TEVAL
  3793. @\begin{verbatim}
  3794.  CtlPtType TEVAL( TrivarType TV,
  3795.                   NumericType UParam,
  3796.                   NumericType VParam,
  3797.                   NumericType WParam )
  3798. @\end{verbatim}
  3799.    Evaluates the provided trivariate {\bf TV} at the given {\bf UParam},
  3800.  {\bf VParam}  and {\bf WParam} values. {\bf UParam}, {\bf VParam},
  3801.  {\bf WParam} must be contained in the surface parametric domain if {\bf TV}
  3802.  is a Bspline surface, or between zero and one if {\bf TV} is a Bezier
  3803.  trivariate. The returned control point has the same type as the control
  3804.  points of {\bf TV}.
  3805.  Example:
  3806. @\begin{verbatim}
  3807.     CPt = TEVAL( TV1, 0.25, 0.22, 0.7 );
  3808. @\end{verbatim}
  3809.  evaluates {\bf TV} at the parameter values of (0.25, 0.22, 0.7).
  3810. @\subsubsection{TINTERP}
  3811. !TINTERP
  3812. @\begin{verbatim}
  3813.  TrivarType TINTERP( TrivarType TV );
  3814. @\end{verbatim}
  3815.    Given a trivariate data structure, computes a new trivariate in the
  3816.  same function space (i.e. same knot sequences and orders) that interpolates
  3817.  the given triavriate, {\bf TV}, at the node parameter values.
  3818.  Example:
  3819. @\begin{verbatim}
  3820.      tv = tbspline( 3, 3, 2,
  3821.                     list( list( list( ctlpt( E3, 0.1, 0.1, 0.0 ),
  3822.                                       ctlpt( E3, 0.2, 0.5, 1.1 ),
  3823.                                       ctlpt( E3, 0.3, 0.1, 2.2 ) ),
  3824.                                 list( ctlpt( E3, 0.4, 1.3, 0.5 ),
  3825.                                       ctlpt( E3, 0.5, 1.7, 1.7 ),
  3826.                                       ctlpt( E3, 0.6, 1.3, 2.9 ) ),
  3827.                                 list( ctlpt( E3, 0.7, 2.4, 0.5 ),
  3828.                                       ctlpt( E3, 0.8, 2.6, 1.4 ),
  3829.                                       ctlpt( E3, 0.9, 2.8, 2.3 ) ) ),
  3830.                           list( list( ctlpt( E3, 1.1, 0.1, 0.5 ),
  3831.                                       ctlpt( E3, 1.3, 0.2, 1.7 ),
  3832.                                       ctlpt( E3, 1.5, 0.3, 2.9 ) ),
  3833.                                 list( ctlpt( E3, 1.7, 1.2, 0.0 ),
  3834.                                       ctlpt( E3, 1.9, 1.4, 1.2 ),
  3835.                                       ctlpt( E3, 1.2, 1.6, 2.4 ) ),
  3836.                                 list( ctlpt( E3, 1.4, 2.3, 0.9 ),
  3837.                                       ctlpt( E3, 1.6, 2.5, 1.7 ),
  3838.                                       ctlpt( E3, 1.8, 2.7, 2.5 ) ) ),
  3839.                           list( list( ctlpt( E3, 2.8, 0.1, 0.4 ),
  3840.                                       ctlpt( E3, 2.6, 0.7, 1.3 ),
  3841.                                       ctlpt( E3, 2.4, 0.2, 2.2 ) ),
  3842.                                 list( ctlpt( E3, 2.2, 1.1, 0.4 ),
  3843.                                       ctlpt( E3, 2.9, 1.2, 1.5 ),
  3844.                                       ctlpt( E3, 2.7, 1.3, 2.6 ) ),
  3845.                                 list( ctlpt( E3, 2.5, 2.9, 0.7 ),
  3846.                                       ctlpt( E3, 2.3, 2.8, 1.7 ),
  3847.                                       ctlpt( E3, 2.1, 2.7, 2.7 ) ) ) ),
  3848.                     list( list( KV_OPEN ),
  3849.                           list( KV_OPEN ),
  3850.                           list( KV_OPEN ) ) );
  3851.     tvi = TINTERP( tv );
  3852. @\end{verbatim}
  3853.  creates a quadratic by quaratic by linear trivairatiate {\bf tvi} that
  3854.  interpolates the control points of {\bf tv} at the node parameter values.
  3855. @\subsubsection{TORUS}
  3856. !TORUS
  3857. @\begin{verbatim}
  3858.  PolygonType TORUS( VectorType Center, VectorType Normal,
  3859.                     NumericType MRadius, NumericType mRadius )
  3860. @\end{verbatim}
  3861.    Creates a TORUS geometric object, defined by {\bf Center} as the center
  3862.  of the TORUS, {\bf Normal} as the normal to the main plane of the TORUS,
  3863.  {\bf MRadius} and {\bf mRadius} as the major and minor radii of the TORUS.
  3864.    See RESOLUTION for the accuracy of the TORUS approximation as a polygonal
  3865.  model. 
  3866.  Example:
  3867. @\begin{verbatim}
  3868.     T = TORUS( vector( 0.0, 0.0, 0.0), vector( 0.0, 0.0, 1.0), 0.5, 0.2 );
  3869. @\end{verbatim}
  3870.  constructs a torus with major plane as the $XY$ plane, major radius of 0.5,
  3871.  and minor radius of 0.2.
  3872. @See Figure~\ref{fig-torus}.
  3873. @\begin{figure}
  3874. @\vspace{2.2in}
  3875. @\special{psfile=user_man/torus.ps hscale=100 vscale=100 hoffset=-40 voffset=-140}
  3876. @\caption{A torus primitive can be constructed using a TORUS constructor...}
  3877. @\label{fig-torus}
  3878. @\end{figure}
  3879. @\subsubsection{TREFINE}
  3880. !TREFINE
  3881. @\begin{verbatim}
  3882.  TrivarType TREFINE( TrivarType TV, ConstantType Direction,
  3883.                      NumericType Replace, ListType KnotList )
  3884. @\end{verbatim}
  3885.    Provides the ability to {\bf Replace} a knot vector of {\bf TV} or refine 
  3886.  it in the specified direction {\bf Direction} (ROW, COL, or DEPTH).
  3887.    {\bf KnotList} is a list of knots to refine {\bf TV} at. All knots should be
  3888.  contained in the parametric domain of {\bf TV} in {\bf Direction}. If the knot
  3889.  vector is replaced, the length of {\bf KnotList} should be identical to the
  3890.  length of the original knot vector of {\bf TV} in {\bf Direction}. If {\bf TV}
  3891.  is a Bezier trivariate, it is automatically promoted to be a Bspline
  3892.  trivariate.
  3893.  Example:
  3894. @\begin{verbatim}
  3895.     TV = TREFINE( TREFINE( TREFINE( TV,
  3896.                                     ROW, FALSE, list( 0.333, 0.667 ) ),
  3897.                            COL, FALSE, list( 0.333, 0.667 ) ),
  3898.                   DEPTH, FALSE, list( 0.333, 0.667 ) );
  3899. @\end{verbatim}
  3900.  refines {\bf TV} in all directions by adding two more knots at 0.333 and
  3901.  0.667.
  3902. @\subsubsection{TREGION}
  3903. !TREGION
  3904. @\begin{verbatim}
  3905.  TrivarType TREGION( TrivarType Srf, ConstantType Direction,
  3906.                      NumericType MinParam, NumericType MaxParam )
  3907. @\end{verbatim}
  3908.    Extracts a region of {\bf TV} between {\bf MinParam} and {\bf MaxParam}
  3909.  in the specified {\bf Direction}. Both {\bf MinParam} and {\bf MaxParam}
  3910.  should be contained in the parametric domain of {\bf TV} in {\bf Direction}.
  3911.  Example:
  3912. @\begin{verbatim}
  3913.     Tv1 = tbezier( list( list( list( ctlpt( E3, 0.1, 0.0, 0.8 ),
  3914.                                      ctlpt( E3, 0.2, 0.1, 2.4 ) ),
  3915.                                list( ctlpt( E3, 0.3, 2.2, 0.2 ),
  3916.                                      ctlpt( E3, 0.4, 2.3, 2.0 ) ) ),
  3917.                          list( list( ctlpt( E3, 2.4, 0.8, 0.1 ),
  3918.                                      ctlpt( E3, 2.2, 0.7, 2.3 ) ),
  3919.                                list( ctlpt( E3, 2.3, 2.6, 0.5 ),
  3920.                                      ctlpt( E3, 2.1, 2.5, 2.7) ) ) ) );
  3921.     Tv1r1 = TREGION( Tv1, row, 0.1, 0.2 );
  3922.     Tv1r2 = TREGION( Tv1, row, 0.4, 0.6 );
  3923.     Tv1r3 = TREGION( Tv1, row, 0.99, 1.0 );
  3924. @\end{verbatim}
  3925.  extracts three regions of {\bf Tv1} along the ROW direction.
  3926. @See Figure~\ref{fig-tregion}.
  3927. @\begin{figure}
  3928. @\vspace{3.3in}
  3929. @\special{psfile=user_man/tregion.ps hscale=100 vscale=100 hoffset=-40 voffset=-110}
  3930. @\caption{A region can be extracted from a freeform trivariate using TREGION.}
  3931. @\label{fig-tregion}
  3932. @\end{figure}
  3933. @\subsubsection{TRIMSRF}
  3934. !TRIMSRF
  3935. @\begin{verbatim}
  3936.  TrimSrfType TRIMSRF( SurfaceType Srf,
  3937.                       CurveType TrimCrv,
  3938.                       NumericType UpperLevel )
  3939.  TrimSrfType TRIMSRF( SurfaceType Srf,
  3940.                       ListType TrimCrvs,
  3941.                       NumericType UpperLevel )
  3942. @\end{verbatim}
  3943.    Creates a trimmed surface from the provided surface {\bf Srf} and the
  3944.  trimming curve {\bf TrimCrv} or curves {\bf TrimCrvs}. If {\bf UpperLevel},
  3945.  an additional trimming curve is automatically being added that contains the
  3946.  entire parametric domain of {\bf Srf}. No validity test is performed on the
  3947.  trimming curves which are assumed two dimensional curves contained in
  3948.  the parametric domain of {\bf Srf}.
  3949.  Example:
  3950. @\begin{verbatim}
  3951.     spts = list( list( ctlpt( E3, 0.1, 0.0, 1.0 ),
  3952.                        ctlpt( E3, 0.3, 1.0, 0.0 ),
  3953.                        ctlpt( E3, 0.0, 2.0, 1.0 ) ),
  3954.                  list( ctlpt( E3, 1.1, 0.0, 0.0 ),
  3955.                        ctlpt( E3, 1.3, 1.5, 2.0 ),
  3956.                        ctlpt( E3, 1.0, 2.1, 0.0 ) ),
  3957.                  list( ctlpt( E3, 2.1, 0.0, 2.0 ),
  3958.                        ctlpt( E3, 2.3, 1.0, 0.0 ),
  3959.                        ctlpt( E3, 2.0, 2.0, 2.0 ) ),
  3960.                  list( ctlpt( E3, 3.1, 0.0, 0.0 ),
  3961.                        ctlpt( E3, 3.3, 1.5, 2.0 ),
  3962.                        ctlpt( E3, 3.0, 2.1, 0.0 ) ),
  3963.                  list( ctlpt( E3, 4.1, 0.0, 1.0 ),
  3964.                        ctlpt( E3, 4.3, 1.0, 0.0 ),
  3965.                        ctlpt( E3, 4.0, 2.0, 1.0 ) ) );
  3966.     sb = sbspline( 3, 3, spts, list( list( KV_OPEN ), list( KV_OPEN ) ) );
  3967.     TCrv1 = cbspline( 2,
  3968.                       list( ctlpt( E2, 0.3, 0.3 ),
  3969.                             ctlpt( E2, 0.7, 0.3 ),
  3970.                             ctlpt( E2, 0.7, 0.7 ),
  3971.                             ctlpt( E2, 0.3, 0.7 ),
  3972.                             ctlpt( E2, 0.3, 0.3 ) ),
  3973.                       list( KV_OPEN ) );
  3974.     TCrv2 = circle( vector( 0.5, 0.5, 0.0 ), 0.25 );
  3975.     TCrv3 = cbspline( 3,
  3976.                       list( ctlpt( E2, 0.3, 0.3 ),
  3977.                             ctlpt( E2, 0.7, 0.3 ),
  3978.                             ctlpt( E2, 0.7, 0.7 ),
  3979.                             ctlpt( E2, 0.3, 0.7 ) ),
  3980.                       list( KV_PERIODIC ) );
  3981.     TSrf1 = TRIMSRF( sb, TCrv1, false );
  3982.     TSrf2 = TRIMSRF( sb, TCrv1, true );
  3983.     TSrf3 = TRIMSRF( sb, list( TCrv1, TcRv2 * ty( 1 ), TCrv3 * ty( 2 ) ),
  3984.                       false );
  3985. @\end{verbatim}
  3986.  constructs three trimmed surfaces. {\bf Tsrf1} contains the out boundary
  3987.  and excludes what is inside {\bf TCrv1}, {\bf TSrf2} contains only the
  3988.  domain inside {\bf TCrv1}. {\bf TCrv3} has three holes corresponds to the
  3989.  three trimming curves.
  3990. @See Figure~\ref{fig-trimsrf}.
  3991. @\begin{figure}
  3992. @\vspace{3.3in}
  3993. @\special{psfile=user_man/trimsrf.ps hscale=100 vscale=100 hoffset=-40 voffset=-140}
  3994. @\caption{Three trimmed surfaces created from the same Bspline surface. In
  3995. @    thin lines is the original surface while in thick lines are the trimmed
  3996. @    surfaces.}
  3997. @\label{fig-trimsrf}
  3998. @\end{figure}
  3999. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4000. @\subsection{Object transformation functions}
  4001. &Object transformation functions
  4002.  All the routines in this section construct a 4 by 4 homogeneous
  4003.  transformation matrix representing the required transform. These matrices
  4004.  may be concatenated to achieve more complex transforms using the matrix
  4005.  multiplication operator $*$. For example, the expression
  4006. @\begin{verbatim}
  4007.     m = trans( vector( -1, 0, 0 ) ) * rotx( 45 ) * trans( vector( 1, 0, 0 ) );
  4008. @\end{verbatim}
  4009.  constructs a transform to rotate an object around the X = 1 line, 45 degrees.
  4010.  A matrix representing the inverse transformation can be computed as:
  4011. @\begin{verbatim}
  4012.     InvM = m ^ -1
  4013. @\end{verbatim}
  4014.  See also overloading of the - operator.
  4015. @\subsubsection{HOMOMAT}
  4016. !HOMOMAT
  4017. @\begin{verbatim}
  4018.  MatrixType HOMOMAT( ListType MatData )
  4019. @\end{verbatim}
  4020.    Creates an arbitrary homogeneous transformation matrix by manually providing
  4021.  its 16 coefficients.
  4022.  Example:
  4023. @\begin{verbatim}
  4024.  for ( a = 1, 1, 720 / step,
  4025.        view_mat = save_mat *
  4026.                   HOMOMAT( list( list( 1, 0, 0, 0 ),
  4027.                                  list( 0, 1, 0, 0 ),
  4028.                                  list( 0, 0, 1, -a * step / 500 ),
  4029.                                  list( 0, 0, 0, 1 ) ) ):
  4030.        view(list(view_mat, b, axes), on)
  4031. @\end{verbatim}
  4032.  looping and viewing through a sequence of perspective transforms, created
  4033.  using the HOMOMAT constructor.
  4034. @\subsubsection{ROTX}
  4035. !ROTX
  4036. @\begin{verbatim}
  4037.  MatrixType ROTX( NumericType Angle )
  4038. @\end{verbatim}
  4039.    Creates a rotation around the X transformation matrix with {\bf Angle} degrees.
  4040. @\subsubsection{ROTY}
  4041. !ROTY
  4042. @\begin{verbatim}
  4043.  MatrixType ROTY( NumericType Angle )
  4044. @\end{verbatim}
  4045.    Creates a rotation around te Y transformation matrix with {\bf Angle} degrees.
  4046. @\subsubsection{ROTZ}
  4047. !ROTZ
  4048. @\begin{verbatim}
  4049.  MatrixType ROTZ( NumericType Angle )
  4050. @\end{verbatim}
  4051.    Creates a rotation around the Z transformation matrix with {\bf Angle} degrees.
  4052. @\subsubsection{SCALE}
  4053. !SCALE
  4054. @\begin{verbatim}
  4055.  MatrixType SCALE( VectorType ScaleFactors )
  4056. @\end{verbatim}
  4057.    Creates a scaling by the {\bf ScaleFactors} transformation matrix.
  4058. @\subsubsection{TRANS}
  4059. !TRANS
  4060. @\begin{verbatim}
  4061.  MatrixType TRANS( VectorType TransFactors )
  4062. @\end{verbatim}
  4063.    Creates a translation by the {\bf TransFactors} transformation matrix.
  4064. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4065. @\subsection{General purpose functions}
  4066. &General purpose functions  
  4067. @\subsubsection{ATTRIB}
  4068. !ATTRIB
  4069. @\begin{verbatim}
  4070.  ATTRIB( AnyType Object, StringType Name, AnyType Value )
  4071. @\end{verbatim}
  4072.    Provides a mechanism to add an attribute of any type to an {\bf Object},
  4073.  with name {\bf Name} and value {\bf Value}. This ATTRIB function is tuned
  4074.  and optimized toward numeric values or strings as {\bf Value} although any
  4075.  other object type can be saved as attribue.
  4076.    These attributes may be used to pass information to other programs about
  4077.  this object, and are saved with the objects in data files. For example,
  4078. @\begin{verbatim}
  4079.     ATTRIB(Glass, "rgb", "255,0,0");
  4080.     ATTRIB(Glass, "refract", 1.4);
  4081.         .
  4082.         .
  4083.         .
  4084.     RMATTR(Glass, "rgb");   # Removes "rgb" attribute.
  4085. @\end{verbatim}
  4086.  sets the RGB color and refraction index of the {\bf Glass} object and
  4087.  later removes the RGB attribute.
  4088.    Attribute names are case insensitive. Spaces are allowed in the {\bf Value}
  4089.  string, as well as the double quote itself, although the latter must be
  4090.  escaped:
  4091. @\begin{verbatim}
  4092.     ATTRIB(Glass, "text", "Say \"this is me\"");
  4093. @\end{verbatim}
  4094.    See also RMATTR for removal of attributes.
  4095. @\subsubsection{CHDIR}
  4096. !CHDIR
  4097. @\begin{verbatim}
  4098.  CHDIR( StringType NewDir )
  4099. @\end{verbatim}
  4100.    Sets the current working directory to be {\bf NewDir}.
  4101. @\subsubsection{CLNTCLOSE}
  4102. !CLNTCLOSE
  4103. @\begin{verbatim}
  4104.  CLNTCLOSE( NumericType Handler, NumericType Kill )
  4105. @\end{verbatim}
  4106.    Closes a communication channel to a client. {\bf Handler} contains the
  4107.  index of the communication channel opened via CLNTEXEC. If {\bf Kill}, the
  4108.  client is send an  exit request for it to die. Otherwise, the communication
  4109.  is closed and the client is running stand alone.  See also CLNTREAD,
  4110.  CLNTWRITE, and CLNTEXEC.
  4111.  Example:
  4112. @\begin{verbatim}
  4113.    h2 = clntexec( "nuldrvs -s-" );
  4114.        .
  4115.        .
  4116.        .
  4117.    CLNTCLOSE( h2,TRUE );
  4118. @\end{verbatim}
  4119.  closes the connection to the nuldrvs client, opened via CLNTEXEC.
  4120. @\subsubsection{CLNTWRITE}
  4121. !CLNTWRITE
  4122. @\begin{verbatim}
  4123.  CLNTWRITE( NumericType Handler, AnyType Object )
  4124. @\end{verbatim}
  4125.    Writes one object {\bf Object} to a communication channel of a client.
  4126.  {\bf Handler} contains the index of the communication channel opened via
  4127.  CLNTEXEC.  See also CLNTREAD, CLNTCLOSE, and CLNTEXEC.
  4128.  Example:
  4129. @\begin{verbatim}
  4130.    h2 = clntexec( "nuldrvs -s-" );
  4131.        .
  4132.        .
  4133.    CLNTWRITE( h2, Model );
  4134.        .
  4135.        .
  4136.    clntclose( h2,TRUE );
  4137. @\end{verbatim}
  4138.  writes the object named Model to client through communication channel h2.
  4139. @\subsubsection{COLOR}
  4140. !COLOR
  4141. @\begin{verbatim}
  4142.  COLOR( GeometricType Object, NumericType Color )
  4143. @\end{verbatim}
  4144.    Sets the color of the object to one of those specified below. Note that an
  4145.  object has a default color (see IRIT.CFG file) according to its origin -
  4146.  loaded with the LOAD command, PRIMITIVE, or BOOLEAN operation result.
  4147.    The system internally supports colors (although you may have a B\&W system)
  4148.  and the colors recognized are:
  4149.  {\bf BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, and WHITE}.
  4150.    See the ATTRIB command for more fine control of colors using the RGB
  4151.  attribute. 
  4152. @\subsubsection{COMMENT}
  4153. !COMMENT
  4154. @\begin{verbatim}
  4155.  COMMENT
  4156. @\end{verbatim}
  4157.  Two types of comments are allowed:
  4158.  1. One-line comment: starts anywhere in a line at the '\#' character, up to
  4159.     the end of the line.
  4160.  2. Block comment: starts at the COMMENT keyword followed by a unique
  4161.     character (anything but white space), up to the second occurrence of that
  4162.     character. This is a fast way to comment out large blocks.
  4163.  Example:
  4164. @\begin{verbatim}
  4165.     COMMENT $
  4166.       This is a comment
  4167.     $
  4168. @\end{verbatim}
  4169. @\subsubsection{ERROR}
  4170. !ERROR
  4171. @\begin{verbatim}
  4172.  ERROR( StringType Message);
  4173. @\end{verbatim}
  4174.  Breaks the execution and returns to IRIT main loop, after printing
  4175.  {\bf Message} to the screen. May be useful in user defined function to
  4176.  break execution in cases of fatal errors.
  4177. @\subsubsection{EXIT}
  4178. !EXIT
  4179. @\begin{verbatim}
  4180.  EXIT();
  4181. @\end{verbatim}
  4182.    Exits from the solid modeler. NO warning is given!
  4183. @\subsubsection{FOR}
  4184. @\begin{verbatim}
  4185.  FOR( NumericType Start, NumericType Increment, NumericType End, AnyType Body )
  4186. @\end{verbatim}
  4187.    Executes the {\bf Body} (see below), while the FOR loop conditions hold.
  4188.    {\bf Start, Increment, End} are evaluated first, and the loop is executed
  4189.  while {\bf $<=$ End} if {\bf Increment $>$ 0}, or while {\bf $>=$ End} if {\bf Increment $<$ 0}.
  4190.    If {\bf Start} is of the form "Variable = Expression", then that variable is
  4191.  updated on each iteration, and can be used within the body.
  4192.    The body may consist of any number of regular commands, separated by
  4193.  COLONs, including nesting FOR loops to an arbitrary level.
  4194.  Example:
  4195. @\begin{verbatim}
  4196.  step = 10;
  4197.  rotstepx = rotx(step);
  4198.  FOR ( a = 1, 1, 360 / step,
  4199.      view_mat = rotstepx * view_mat:
  4200.      view( list( view_mat, b, axes ), ON )
  4201. @\end{verbatim}
  4202.  Displays b and axes with a view direction that is rotated 10 degrees at a
  4203.  time around the X axis.
  4204. @\subsubsection{HELP}
  4205. !HELP
  4206. @\begin{verbatim}
  4207.  HELP( StringType Subject )
  4208. @\end{verbatim}
  4209.    Provides help on the specified Subject.
  4210.  Example:
  4211. @\begin{verbatim}
  4212.     HELP("");
  4213. @\end{verbatim}
  4214.  will list all {\em IRIT} help subjects.
  4215. @\subsubsection{FREE}
  4216. !FREE
  4217. @\begin{verbatim}
  4218.  FREE( GeometricType Object )
  4219. @\end{verbatim}
  4220.    Because of the usually huge size of geometric objects, this procedure
  4221.  may be used to free them. Reassigning a value (even of different type)
  4222.  to a variable automatically releases the old variable's allocated space
  4223.  as well.
  4224. @\subsubsection{FUNCTION}
  4225. !FUNCTION
  4226. @\begin{verbatim}
  4227.  FuncName = FUNCTION(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  4228.      FuncBody;
  4229. @\end{verbatim}
  4230.  Defines a function named FuncName with N parameters and M local variables
  4231.  $(N, M >= 0)$. Here is a (simple) example of a function with no local variables
  4232.  and a single parameter that computes the square of a number:
  4233. @\begin{verbatim}
  4234.  sqr = FUNCTION(x):
  4235.     return = x * x;
  4236. @\end{verbatim}
  4237.    Functions can be defined with optional parameters and optional local
  4238.  variables. A function's body may contain an arbitrary set of expressions
  4239.  including for loops, (user) function calls, or even recursive function calls,
  4240.  all separated by colons.
  4241.    The returned value of the function is the value of an automatically defined
  4242.  local variable named return. The return variable is a regular local variable
  4243.  within the scope of the function and can be used as any other variable.
  4244.    If a variable's name is found in neither the local variable list nor
  4245.  the parameter list, it is searched in the global variable list (outside
  4246.  the scope of the function). Binding of names of variables is static as in the
  4247.  C programming language.
  4248.    Because binding of variables is performed in execution time, there is a
  4249.  somewhat less restrictive type checking of parameters of functions that are
  4250.  invoked within a user's defined function.
  4251.    A function can invoke itself, i.e., it can be recursive. However, since a
  4252.  function should be defined when it is called, a dummy function should be
  4253.  defined before the recursive one is defined:
  4254. @\begin{verbatim}
  4255.  factorial = function(x):return = x; # Dummy function.
  4256.  factorial = function(x):
  4257.      if (x <= 1, return = 1, return = x * factorial(x - 1));
  4258. @\end{verbatim}
  4259.    Overloading is valid inside a function as it is outside. For example, for
  4260. @\begin{verbatim}
  4261.  add = FUNCTION(x, y):
  4262.     return = x + y;
  4263. @\end{verbatim}
  4264.  the following function calls are all valid:
  4265. @\begin{verbatim}
  4266.  add(1, 2);
  4267.  add(vector(1,2,3), point(1,2,3));
  4268.  add(box(vector(-3, -2, -1), 6, 4, 2), box(vector(-4, -3, -2), 2, 2, 4));
  4269. @\end{verbatim}
  4270.  Finally, here is a more interesting example that computes an approximation
  4271.  of the length of a curve, using the sqr function defined above:
  4272. @\begin{verbatim}
  4273.  distptpt = FUNCTION(pt1, pt2):
  4274.      return = sqrt(sqr(coord(pt1, 1) - coord(pt2, 1)) +
  4275.                    sqr(coord(pt1, 2) - coord(pt2, 2)) +
  4276.                    sqr(coord(pt1, 3) - coord(pt2, 3)));
  4277.  crvlength = FUNCTION(crv, n):pd:t:t1:t2:dt:pt1:pt2:i:
  4278.      return = 0.0:
  4279.      pd = pdomain(crv):
  4280.      t1 = nth(pd, 1):
  4281.      t2 = nth(pd, 2):
  4282.      dt = (t2 - t1) / n:
  4283.      pt1 = coerce(ceval(crv, t1), e3):
  4284.      for (i = 1, 1, n,
  4285.           pt2 = coerce(ceval(crv, t1 + dt * i), e3):
  4286.           return = return + distptpt(pt1, pt2):
  4287.           pt1 = pt2);
  4288. @\end{verbatim}
  4289.  Try, for example:
  4290. @\begin{verbatim}
  4291.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 30) / 2;
  4292.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 100) / 2;
  4293.  crvlength(circle(vector(0.0, 0.0, 0.0), 1.0), 300) / 2;
  4294. @\end{verbatim}
  4295.  See PROCEDURE and IRITSTATE's "DebugFunc" for more.
  4296. @\subsubsection{IF}
  4297. @\begin{verbatim}
  4298.  IF( NumericType Cond, AnyType TrueBody { , AnyType FalseBody } )
  4299. @\end{verbatim}
  4300.    Executes {\bf TrueBody} (group of regular commands, separated by COLONs -
  4301.  see FOR loop) if the {\bf Cond} holds, i.e., it is a numeric value other than
  4302.  zero, or optionally, if it exists, executes {\bf FalseBody} if the {\bf Cond}
  4303.  does not hold, i.e., it evaluates to a numeric value equal to zero.
  4304.  Examples:
  4305. @\begin{verbatim}
  4306.     IF ( machine == IBMOS2, resolution = 5, resolution = 10 );
  4307.     IF ( a > b, max = a, max = b );
  4308. @\end{verbatim}
  4309.  sets the resolution to be 10, unless running on an IBMOS2 system, in which
  4310.  case the resolution variable will be set to 5 in the first statement, and
  4311.  set max to the maximum of a and b in the second statement.
  4312. @\subsubsection{INCLUDE}
  4313. !INCLUDE
  4314. @\begin{verbatim}
  4315.  INCLUDE( StringType FileName )
  4316. @\end{verbatim}
  4317.    Executes the script file {\bf FileName}. Nesting of include file is allowed up
  4318.  to 10 levels deep. If an error occurs, all open files in all nested files
  4319.  are closed and data are waited for at the top level (standard input).
  4320.    A script file can contain any command the solid modeler supports.
  4321.  Example:
  4322. @\begin{verbatim}
  4323.     INCLUDE( "general.irt" );
  4324. @\end{verbatim}
  4325.  includes the file "general.irt".
  4326. @\subsubsection{IRITSTATE}
  4327. !IRITSTATE
  4328. @\begin{verbatim}
  4329.  IRITSTATE( StringType State, AnyType Data )
  4330. @\end{verbatim}
  4331.    Sets a state variable in the {\em IRIT} solid modeller. Current supported
  4332.  state variables are,
  4333. # 13 3 1 1
  4334.  State Name
  4335.  Data Type
  4336.  Comments
  4337.  InterpProd
  4338.  ConstantType
  4339.  TRUE for Bspline sym. products via interpolation
  4340.  FALSE for Bspline sym. products via bezier
  4341.  DebugFunc
  4342.  NumericType
  4343.  $>0$ user func. debug information. $>2$ print params
  4344.  on entry, ret. val. on exit. $>4$ global var. list
  4345.  FloatFrmt
  4346.  StringType
  4347.  Specifies a new printf floating point format.
  4348.  InterCrv
  4349.  NumericType
  4350.  If TRUE Boolean operations creates only
  4351.  intersection curves. If FALSE, full Boolean
  4352.  operation results.
  4353.  Coplanar
  4354.  NumericType
  4355.  If TRUE, Coplanar polygons are handled by Boolean
  4356.  operations.
  4357.  PolySort
  4358.  NumericType
  4359.  Axis of Polygon Intersection sweep in Boolean
  4360.  operations: 0 for X axis, 1 for Y axis, 2 for
  4361.  Z axis.
  4362.  EchoSource
  4363.  NumericType
  4364.  If TRUE, irit scripts are echoed to stdout.
  4365.  DumpLevel
  4366.  NumericType
  4367.  Controls the way variables/expressions ar dumped.
  4368.  Only object names/types if $>=$ 0, Scalars and
  4369.  vectors are dumped if $>=$ 1, Curves and Surfaces
  4370.  are dumped if DumpLvl $>=$ 2, Polygons/lines are
  4371.  dumped if DumpLvl $>=$ 3, and List objects are
  4372.  traversed recursively if DumpLvl $>=$ 4.
  4373.  TrimCrvs
  4374.  NumericType
  4375.  Number of samples the higher order trimmed curves
  4376.  are sampled, in piecewise linear approximation.
  4377.  If zero, computed symbolically as composition.
  4378.  Example:
  4379. @\begin{verbatim}
  4380.     IRITSTATE( "DebugFunc", 3 );
  4381.     IRITSTATE( "FloatFrmt", "%8.5lg" );
  4382. @\end{verbatim}
  4383.  To print parameters of user defined functions on entry, and return value on
  4384.  exit. Also selects a floating point printf format of "%8.5lg".
  4385. @\subsubsection{INTERACT}
  4386. !INTERACT
  4387. @\begin{verbatim}
  4388.  INTERACT( GeometryTreeType Object )
  4389. @\end{verbatim}
  4390.    A user-defined function (see iritinit.irt) that does the following,
  4391.  in order:
  4392. @\begin{enumerate}
  4393. @\item
  4394.  Clear the display device.
  4395. @\item
  4396.  Display the given {\bf Object}.
  4397. @\item
  4398.  Pause for a keystroke.
  4399. @\end{enumerate}
  4400.    This user-defined function in version 4.0 of {\em IRIT} is an
  4401.  emulation of the INTERACT function that used to exist in previous versions.
  4402.  Example:
  4403. @\begin{verbatim}
  4404.  INTERACT( list( view_mat, Axes, Obj ) );
  4405. @\end{verbatim}
  4406.  displays and interacts with the object {\bf Obj} and the predefined object
  4407.  {\bf Axes}. VIEW\_MAT will be used to set the starting transformation.
  4408.    See VIEW and VIEWOBJ for more.
  4409. @\subsubsection{LIST}
  4410. !LIST
  4411. @\begin{verbatim}
  4412.  ListType LIST( AnyType Elem1, AnyType Elem2, ... )
  4413. @\end{verbatim}
  4414.    Constructs an object as a list of several other objects. Only a reference
  4415.  is made to the Elements, so modifying Elem1 after being included in the list
  4416.  will affect Elem1 in that list next time list is used!
  4417.    Each inclusion of an object in a list increases its internal {\bf used}
  4418.  reference. The object is freed iff in {\bf used} reference is zero.
  4419.    As a result, attempt to delete a variable (using FREE) which is referenced
  4420.  in a list removes the variable, but the object itself is freed only when the
  4421.  list is freed.
  4422. @\subsubsection{LOAD}
  4423. !LOAD
  4424. @\begin{verbatim}
  4425.  AnyType LOAD( StringType FileName )
  4426. @\end{verbatim}
  4427.    Loads an object from the given {\bf FileName}. The object may be any object
  4428.  defined in the system, including lists, in which the structure is recovered
  4429.  and reconstructed as well (internal objects are inserted into the global
  4430.  system object list if they have names). If no file type is provided, ".dat"
  4431.  is assumed.
  4432.    This command can also be used to load binary files. Ascii regular data
  4433.  files are usually loaded in much more time then binary files due the 
  4434.  the parsing required. Binary data files can be loaded directly like ascii
  4435.  files in {\em IRIT}, but can only be inspected through {\bf IRIT} tools such
  4436.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  4437.  its name.
  4438.    Under unix, compressed files can be loaded if the given file name has
  4439.  a postfix of ".Z". The unix system's "zcat" will be invoked via a pipe
  4440.  for that purpose.
  4441. @\subsubsection{LOGFILE}
  4442. !LOGFILE
  4443. @\begin{verbatim}
  4444.  LOGFILE( NumericType Set )
  4445.  LOGFILE( StringType FileName )
  4446. @\end{verbatim}
  4447.    If {\bf Set} is non zero (see TRUE/FALSE and ON/OFF), then everything
  4448.  printed in the input window, will go to the log file specified in the
  4449.  IRIT.CFG configuration file. This file will be created the first time
  4450.  logfile is turned ON. If a string {\bf FileName} is provided, it will
  4451.  be used as a log file name from now on. It also closes the current log
  4452.  file. A "LOGFILE( on );" must be issued after a log file name change.
  4453.  Example:
  4454. @\begin{verbatim}
  4455.     LOGFILE( "Data1" );    
  4456.     LOGFILE( on );    
  4457.     printf( "Resolution = %lf\\n", list( resolution ) );
  4458.     LOGFILE( off );    
  4459. @\end{verbatim}
  4460.  to print the current resolution level into file Data1.
  4461. @\subsubsection{MSLEEP}
  4462. !MSLEEP
  4463. @\begin{verbatim}
  4464.  MSLEEP( NumericType MilliSeconds )
  4465. @\end{verbatim}
  4466.  Causes the solid modeller to sleep for the prescribed time in milliseconds.
  4467.  Example:
  4468. @\begin{verbatim}
  4469.  for ( i = 1, 1, sizeof( crvs ),
  4470.      c = nth( crvs, i ):
  4471.      color( c, yellow ):
  4472.      msleep(20):
  4473.      viewobj( c )
  4474. @\end{verbatim}
  4475.  Displays an animation sequence and sleeps for 20 milliseconds between
  4476.  iterations.
  4477. @\subsubsection{NTH}
  4478. @\begin{verbatim}
  4479.  AnyType NTH( ListType ListObject, NumericType Index )
  4480. @\end{verbatim}
  4481.  Returns the {\bf Index} (base count 1) element of the list {\bf ListObject}.
  4482.  Example:
  4483. @\begin{verbatim}
  4484.     Lst = list( a, list( b, c ), d );
  4485.     Lst2 = NTH( Lst, 2 );
  4486. @\end{verbatim}
  4487.  and now {\bf Lst2} is equal to 'list( b, c )'.
  4488. @\subsubsection{PAUSE}
  4489. !PAUSE
  4490. @\begin{verbatim}
  4491.  PAUSE( NumericType Flush )
  4492. @\end{verbatim}
  4493.    Waits for a keystroke. Nice to have if a temporary stop in a middle of an
  4494.  included file (see INCLUDE) is required. If {\bf Flush} is TRUE, then the input
  4495.  is first flushed to guarantee that the actual stop will occur.
  4496. @\subsubsection{PRINTF}
  4497. !PRINTF
  4498. @\begin{verbatim}
  4499.  PRINTF( StringType CtrlStr, ListType Data )
  4500. @\end{verbatim}
  4501.  A formatted printing routine, following the concepts of the C programming
  4502.  language's {\em printf} routine. {\bf CtrlStr} is a string object for which
  4503.  the following special '\%' commands are supported:
  4504. #15 2 0 1
  4505.  \%d, \%i, %u
  4506.   Prints the numeric object as an integer or unsigned integer.
  4507.  \%o, \%x, \%X
  4508.   Prints the numeric object as an octal or hexadecimal integer.
  4509.  \%e, \%f, \%g,
  4510.   Prints the numeric object in several formats of
  4511.  \%E, \%F
  4512.   floating point numbers.
  4513.   Prints the string object as a string.
  4514.  \%pe, \%pf, \%pg
  4515.   Prints the three coordinates of the point object.
  4516.  \%ve, \%vf, \%vg
  4517.   Prints the three coordinates of the vector object.
  4518.  \%Pe, \%Pf, \%Pg,
  4519.   Prints the four coordinates of the plane object.
  4520.  \%De, \%Df, \%Dg,
  4521.   Prints the given object in IRIT's data file format.
  4522.  All the '\%' commands can include any modifier that is valid in the C
  4523.  programming language printf routine, including l (long), prefix
  4524.  character(s), size, etc. The point, vector, plane, and object commands
  4525.  can also be modified in a similar way, to set the format of the
  4526.  numeric data printed.
  4527.  Also supported are the newline and tab using the backslash escape
  4528.  character:
  4529. @\begin{verbatim}
  4530. * PRINTF("\\tThis is the char \"\\%\"\\n", nil());
  4531. @\end{verbatim}
  4532.  Backslashes should be escaped themselves as can be seen in the above example.
  4533.  Here are few more examples:
  4534. @\begin{verbatim}
  4535. * PRINTF("this is a string \"%s\" and this is an integer %8d.\\n",
  4536. *       list("STRING", 1987));
  4537. * PRINTF("this is a vector [%8.5lvf]\\n", list(vector(1,2,3)));
  4538. * IritState("DumpLevel", 9);
  4539. * PRINTF("this is a object %8.6lDf...\\n", list(axes));
  4540. * PRINTF("this is a object %10.8lDg...\\n", list(axes));
  4541. @\end{verbatim}
  4542.  This implementation of PRINTF is somewhat different than the C programming
  4543.  language's version, because the backslash {\em always} escapes the next
  4544.  character during the processing stage of IRIT's parser. That is, the string
  4545. @\begin{verbatim}
  4546. *        '\\tThis is the char \"\\%\"\\n'
  4547. @\end{verbatim}
  4548.  is actually parsed by the IRIT's parser into
  4549. @\begin{verbatim}
  4550. *        '\tThis is the char "\%"\n'
  4551. @\end{verbatim}
  4552.  because this is the way the IRIT parser processes strings. The latter
  4553.  string is the one that PRINTF actually see.
  4554. @\subsubsection{PROCEDURE}
  4555. !PROCEDURE
  4556. @\begin{verbatim}
  4557.  ProcName = PROCEDURE(Prm1, Prm2, ... , PrmN):LclVal1:LclVar2: ... :LclVarM:
  4558.      ProcBody;
  4559. @\end{verbatim}
  4560.  A procedure is a function that does not return a value, and therefore the
  4561.  return variable (see FUNCTION) should not be used. A procedure is
  4562.  identical to a function in every other way. See FUNCTION for more.
  4563. @\subsubsection{RMATTR}
  4564. !RMATTR
  4565. @\begin{verbatim}
  4566.  RMATTR( AnyType Object, StringType Name )
  4567. @\end{verbatim}
  4568.    Removes attribute named {\bf Name} from object {\bf Object}. This function
  4569.  will have no affect on {\bf Object} if {\bf Object} have no attribute named
  4570.  {\bf Name}.
  4571.  See also ATTRIB.
  4572. @\subsubsection{SAVE}
  4573. !SAVE
  4574. @\begin{verbatim}
  4575.  SAVE( StringType FileName, AnyType Object )
  4576. @\end{verbatim}
  4577.    Saves the provided {\bf Object} in the specified file name {\bf FileName}.
  4578.  No extension type is needed (ignored if specified), and ".dat" is supplied
  4579.  by default. {\bf Object} can be any object type, including list, in which
  4580.  structure is saved recursively. See also LOAD. If a display device is
  4581.  actively running at the time SAVE is invoked, its transformation matrix
  4582.  will be saved with the same name but with extension type of ".mat" instead
  4583.  of ".dat".
  4584.    This command can also be used to save binary files. Ascii regular data
  4585.  files are usually loaded in much more time then binary files due the 
  4586.  the parsing required. Binary data files can be loaded directly like ascii
  4587.  files in {\em IRIT}, but must be inspected through {\bf IRIT} tools such
  4588.  as dat2irit. A binary data file must have a ".bdt" (Binary DaTa) type in
  4589.  its name.
  4590.    Under unix, files will be saved compressed if the given file name has
  4591.  a postfix of ".Z". The unix system's "compress" will be invoked via a pipe
  4592.  for that purpose.
  4593.    Example:
  4594. @\begin{verbatim}
  4595.  SAVE( "Obj1.bdt.Z", Obj1 );
  4596. @\end{verbatim}
  4597.  Saves Obj1 in the file Obj1.bdt.Z as compressed binary file.
  4598. @\subsubsection{SNOC}
  4599. !SNOC
  4600. @\begin{verbatim}
  4601.  SNOC( AnyType Object, ListType ListObject )
  4602. @\end{verbatim}
  4603.    Similar to the lisp cons operator but puts the new {\bf Object} in the
  4604.  {\em end} of the list {\bf ListObject} instead of the beginning, in place.
  4605.  Example:
  4606. @\begin{verbatim}
  4607.     Lst = list( axes );
  4608.     SNOC( Srf, Lst );
  4609. @\end{verbatim}
  4610.  and now {\bf Lst} is equal to the list 'list( axes, Srf )'.
  4611. @\subsubsection{SYSTEM}
  4612. !SYSTEM
  4613. @\begin{verbatim}
  4614.  SYSTEM( StringType Command )
  4615. @\end{verbatim}
  4616.    Executes a system command {\bf Command}. For example,
  4617. @\begin{verbatim}
  4618.     SYSTEM( "ls -l" );
  4619. @\end{verbatim}
  4620. @\subsubsection{TIME}
  4621. !TIME
  4622. @\begin{verbatim}
  4623.  TIME( NumericType Reset )
  4624. @\end{verbatim}
  4625.    Returns the time in seconds from the last time TIME was called with
  4626.  {\bf Reset} TRUE. This time is CPU time if such support is available
  4627.  from the system (times function), and is real time otherwise (time
  4628.  function).
  4629.    The time is automatically reset at the beginning of the execution of this
  4630.  program.
  4631.  Example:
  4632. @\begin{verbatim}
  4633.     Dummy = TIME( TRUE );
  4634.       .
  4635.       .
  4636.       .
  4637.     TIME( FALSE );
  4638. @\end{verbatim}
  4639.  prints the time in seconds between the above two time function calls.
  4640. @\subsubsection{VARLIST}
  4641. !VARLIST
  4642. @\begin{verbatim}
  4643.  VARLIST()
  4644. @\end{verbatim}
  4645.    List all the currently defined objects in the system.
  4646. @\subsubsection{VECTOR}
  4647. !VECTOR
  4648. @\begin{verbatim}
  4649.  VectorType VECTOR( NumericType X, NumericType Y, NumericType Z )
  4650. @\end{verbatim}
  4651.    Creates a vector type object, using the three provided NumericType scalars.
  4652. @\subsubsection{VIEW}
  4653. !VIEW
  4654. @\begin{verbatim}
  4655.  VIEW( GeometricTreeType Object, NumericType ClearWindow )
  4656. @\end{verbatim}
  4657.    Displays the (geometric) object(s) as given in {\bf Object}.
  4658.    If {\bf ClearWindow} is non-zero (see TRUE/FALSE and ON/OFF) the window is
  4659.  first cleared (before drawing the objects).
  4660.  Example:
  4661. @\begin{verbatim}
  4662.     VIEW( Axes, FALSE );
  4663. @\end{verbatim}
  4664.  displays the predefined object {\bf Axes} in the viewing window on top of
  4665.  what is drawn already.
  4666.  In version 4.0, this function is emulated (see iritinit.irt) using the
  4667.  VIEWOBJ function. In order to use the current viewing matrix, VIEW\_MAT
  4668.  should be provided as an additional parameter. For example,
  4669. @\begin{verbatim}
  4670.     VIEW( list( view_mat, Obj ), TRUE );
  4671. @\end{verbatim}
  4672.  However, since VIEW is a user defined function, the following will not
  4673.  use VIEW\_MAT as one would expect:
  4674. @\begin{verbatim}
  4675.     VIEW( view_mat, TRUE );
  4676. @\end{verbatim}
  4677.  because VIEW\_MAT will be renamed inside the VIEW user defined function to
  4678.  a local (to the user defined function) variable.
  4679.  In iritinit.irt one can find several other useful VIEW related functions:
  4680. # 15 2 0 1
  4681.  VIEWCLEAR
  4682.   Clears all data displayed on the display device.
  4683.  VIEWREMOVE
  4684.   Removes the object specified by name from display.
  4685.  VIEWDISC
  4686.   Disconnects from display device (which is still running)
  4687.   while allowing IRIT to connect to a new device.
  4688.  VIEWEXIT
  4689.   Forces the display device to exit.
  4690.  VIEWSAVE
  4691.   Request sdisplay device to save transformation matrix.
  4692.  BEEP
  4693.   An emulation of the BEEP command of versions prior to 4.0.
  4694.  VIEWSTATE
  4695.   Allows to change the state of the display device.
  4696.    For the above VIEW related functions, only VIEWREMOVE, VIEWSAVE, and
  4697.  VIEWSTATE require a parameter, which is the file name and view state
  4698.  respectively. The view state can be one of several commands. See the
  4699.  display device section for more.
  4700.  Examples:
  4701. @\begin{verbatim}
  4702.     VIEWCLEAR();
  4703.     VIEW( axes, off );
  4704.     VIEWSTATE( "LngrVecs" );
  4705.     VIEWSTATE( "DrawSolid" );
  4706.     VIEWSAVE( "matrix1" );
  4707.     VIEWREMOVE( "axes" );
  4708.     VIEWDISC();
  4709. @\end{verbatim}
  4710. @\subsubsection{VIEWOBJ}
  4711. !VIEWOBJ
  4712. @\begin{verbatim}
  4713.  VIEWOBJ( GeometricTreeType Object )
  4714. @\end{verbatim}
  4715.    Displays the (geometric) object(s) as given in {\bf Object}.
  4716.  {\bf Object} may be any GeometricType or a list of other
  4717.  GeometricTypes nested to an arbitrary level.
  4718.    Unlike {\em IRIT} versions prior to 4.0, VIEW\_MAT is not explicitly used
  4719.  as the transformation matrix. In order to display with a VIEW\_MAT view,
  4720.  VIEW\_MAT should be listed as an argument (in that exact name) to
  4721.  VIEWOBJ. Same is true for the perspective matrix PRSP\_MAT.
  4722.  Example:
  4723. @\begin{verbatim}
  4724.     VIEWOBJ( list( view_mat, Axes ) );
  4725. @\end{verbatim}
  4726.  displays the predefined object {\bf Axes} in the viewing window using the
  4727.  viewing matrix VIEW\_MAT.
  4728. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4729. @\subsection{System variables}
  4730. &System variables
  4731.  System variables are predefined objects in the system. Any time {\em IRIT} is
  4732.  executed, these variable are automatically defined and set to values which
  4733.  are sometimes machine dependent. These are {\em regular} objects in any other
  4734.  sense, including the ability to delete or overwrite them. One can modify,
  4735.  delete, or introduce other objects using the IRITINIT.IRT file.
  4736. @\subsubsection{AXES}
  4737. !AXES
  4738.    Predefined polyline object (PolylineType) that describes the $XYZ$ axes.
  4739. @\subsubsection{DRAWCTLPT}
  4740. !DRAWCTLPT
  4741.    Predefined Boolean variable (NumericType) that controls whether curves'
  4742.  control polygons and surfaces' control meshes are drawn (TRUE) or not
  4743.  (FALSE). Default is FALSE.
  4744. @\subsubsection{FLAT4PLY}
  4745. !FLAT4PLY
  4746.    Predefined Boolean object (NumericType) that controls the way almost flat
  4747.  surface patches are converted to polygons: four polygons (TRUE) or only
  4748.  two polygons (FALSE). Default value is FALSE.
  4749. @\subsubsection{MACHINE}
  4750. !MACHINE
  4751.    Predefined numeric object (NumericType) holding the machine type as one of
  4752.  the following constants: MSDOS, SGI, HP, SUN, APOLLO, UNIX, IBMOS2, IBMNT,
  4753.  and AMIGA.
  4754. @\subsubsection{ POLY\_APPROX\_OPT}
  4755. !POLY_APPROX_OPT
  4756.    A variable controlling the algorithm to convert surfaces to polygons.
  4757.    This two digit number control the method that is used to subdivide a surface
  4758.  into polygons.
  4759.    The first digit (units) can be one of:
  4760. # 4 2 0 1
  4761.   An alternate U and V subdivision direction. Once U is
  4762.   subdivided and then V is subdivided.
  4763.   A min max subdivision direction. In other words, the
  4764.   direction that minimizes the maximal error is selected.
  4765.    The second digit (tenths) can be one of:
  4766. # 4 2 0 1
  4767.   A fixed sized regular grid. The side of the grid is set
  4768.   via the RESOLUTION variable.
  4769.   This mode is {\em not} for general use.
  4770.   Maximal distance between the surface and its polygonal
  4771.   approximation is bounded by bilinear surface fit.
  4772.   Maximal distance allowed is set via POLY\_APPROX\_TOL.
  4773.   {\em Recommended} choice for optimal polygonization.
  4774.   This mode is {\em not} for general use.
  4775. @\subsubsection{POLY\_APPROX\_UV}
  4776. !POLY_APPROX_UV
  4777.    A Boolean predefined variable. If TRUE, UV values of surface polygonal
  4778.  approximation are placed on attribute lists of vertices.
  4779. @\subsubsection{POLY\_APPROX\_TOL}
  4780. !POLY_APPROX_TOL
  4781.    A numeric predefined tolerance control on the distance between the surface
  4782.  and its polygonal approximation in POLY\_APPROX\_OPT settings.
  4783. @\subsubsection{PRSP\_MAT}
  4784. !PRSP_MAT
  4785.    Predefined matrix object (MatrixType) to hold the perspective matrix
  4786.  used/set by VIEW and/or INTERACT commands. See also VIEW\_MAT.
  4787. @\subsubsection{RESOLUTION}
  4788. !RESOLUTION
  4789.    Predefined numeric object (NumericType) that sets the accuracy of the
  4790.  polygonal primitive geometric objects and the approximation of curves and
  4791.  surfaces. Holds the number of divisions a circle is divided into (with
  4792.  minimum value of 4). If, for example, RESOLUTION is set to 6, then a
  4793.  generated CONE will effectively be a six-sided pyramid.
  4794.    Also controls the fineness of freeform curves and surfaces when they are
  4795.  approximated as piecewise linear polylines, and the fineness of freeform
  4796.  surfaces when they are approximated as polygons.
  4797. @\subsubsection{VIEW\_MAT}
  4798. !VIEW_MAT
  4799.    Predefined matrix object (MatrixType) to hold the viewing matrix used/set
  4800.  by VIEW and/or INTERACT commands. See also PRSP\_MAT.
  4801. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4802. @\subsection{System constants}
  4803. &System constants
  4804.  The following constants are used by the various functions of the system to
  4805.  signal certain conditions. Internally, they are represented numerically,
  4806.  although, in general, their exact value is unimportant and may be changed
  4807.  in future versions. In the rare circumstance that  you need to know their
  4808.  values, simply type the constant as an expression.
  4809.  Example:
  4810. @\begin{verbatim}
  4811.     MAGENTA;
  4812. @\end{verbatim}
  4813. @\subsection{AMIGA}
  4814. !AMIGA
  4815.  A constant designating an AMIGA system, in the MACHINE variable.
  4816. @\subsubsection{APOLLO}
  4817. !APOLLO
  4818.  A constant designating an APOLLO system, in the MACHINE variable.
  4819. @\subsubsection{BLACK}
  4820. !BLACK
  4821.  A constant defining a BLACK color.
  4822. @\subsubsection{BLUE}
  4823. !BLUE
  4824.  A constant defining a BLUE color.
  4825. @\subsubsection{COL}
  4826.  A constant defining the COLumn direction of a surface or a trivariate mesh.
  4827. @\subsubsection{CTLPT\_TYPE}
  4828. !CTLPT_TYPE
  4829.  A constant defining an object of type control point.
  4830. @\subsubsection{CURVE\_TYPE}
  4831. !CURVE_TYPE
  4832.  A constant defining an object of type curve.
  4833. @\subsubsection{CYAN}
  4834. !CYAN
  4835.  A constant defining a CYAN color.
  4836. @\subsubsection{DEPTH}
  4837. !DEPTH
  4838.   A constant defining the DEPTH direction of a trivariate mesh.
  4839.  See TBEZIER, TBSPLINE.
  4840. @\subsubsection{E1}
  4841.  A constant defining an E1 (X only coordinate) control point type.
  4842. @\subsubsection{E2}
  4843.  A constant defining an E2 (X and Y coordinates) control point type.
  4844. @\subsubsection{E3}
  4845.  A constant defining an E3 (X, Y and Z coordinates) control point type.
  4846. @\subsubsection{E4}
  4847.  A constant defining an E4 control point type.
  4848. @\subsubsection{E5}
  4849.  A constant defining an E5 control point type.
  4850. @\subsubsection{FALSE}
  4851. !FALSE
  4852.  A zero constant. May be used as Boolean operand.
  4853. @\subsubsection{GREEN}
  4854. !GREEN
  4855.  A constant defining a GREEN color.
  4856. @\subsubsection{HP}
  4857.  A constant designating an HP system, in the MACHINE variable.
  4858. @\subsubsection{IBMOS2}
  4859. !IBMOS
  4860.  A constant designating an IBM system running under OS2, in the MACHINE
  4861.  variable.
  4862. @\subsubsection{IBMNT}
  4863. !IBMNT
  4864.  A constant designating an IBM system running under Windows NT, in the MACHINE
  4865.  variable.
  4866. @\subsubsection{KV\_FLOAT}
  4867. !KV_FLOAT
  4868.  A constant defining a floating end condition uniformly spaced knot vector.
  4869. @\subsubsection{KV\_OPEN}
  4870. !KV_OPEN
  4871.  A constant defining an open end condition uniformly spaced knot vector.
  4872. @\subsubsection{KV\_PERIODIC}
  4873. !KV_PERIODIC
  4874.  A constant defining a periodic end condition with uniformly spaced knot
  4875.  vector.
  4876. @\subsubsection{LIST\_TYPE}
  4877. !LIST_TYPE
  4878.  A constant defining an object of type list.
  4879. @\subsubsection{MAGENTA}
  4880. !MAGENTA
  4881.  A constant defining a MAGENTA color.
  4882. @\subsubsection{MATRIX\_TYPE}
  4883. !MATRIX_TYPE
  4884.  A constant defining an object of type matrix.
  4885. @\subsubsection{MSDOS}
  4886. !MSDOS
  4887.  A constant designating an MSDOS system, in the MACHINE variable.
  4888. @\subsubsection{NUMERIC\_TYPE}
  4889. !NUMERIC_TYPE
  4890.  A constant defining an object of type numeric.
  4891. @\subsubsection{OFF}
  4892.  Synonym of FALSE.
  4893. @\subsubsection{ON}
  4894.  Synonym for TRUE.
  4895. @\subsubsection{P1}
  4896.  A constant defining a P1 (W and WX coordinates, in that order) rational
  4897.  control point type.
  4898. @\subsubsection{P2}
  4899.  A constant defining a P2 (W, WX, and WY coordinates, in that order) rational
  4900.  control point type.
  4901. @\subsubsection{P3}
  4902.  A constant defining a P3 (W, WX, WY, and WZ coordinates, in that order)
  4903.  rational control point type.
  4904. @\subsubsection{P4}
  4905.  A constant defining a P4 rational control
  4906.  point type.
  4907. @\subsubsection{P5}
  4908.  A constant defining a P5 rational control
  4909.  point type.
  4910. @\subsubsection{PARAM\_CENTRIP}
  4911. !PARAM_CENTRIP
  4912.  A constant defining a centripetal length parametrization.
  4913. @\subsubsection{PARAM\_CHORD}
  4914. !PARAM_CHORD
  4915.  A constant defining a chord length parametrization.
  4916. @\subsubsection{PARAM\_UNIFORM}
  4917. !PARAM_UNIFORM
  4918.  A constant defining an uniform parametrization.
  4919. @\subsubsection{PI}
  4920.  The constant of 3.141592...
  4921. @\subsubsection{PLANE\_TYPE}
  4922. !PLANE_TYPE
  4923.  A constant defining an object of type plane.
  4924. @\subsubsection{POINT\_TYPE}
  4925. !POINT_TYPE
  4926.  A constant defining an object of type point.
  4927. @\subsubsection{POLY\_TYPE}
  4928. !POLY_TYPE
  4929.  A constant defining an object of type poly.
  4930. @\subsubsection{RED}
  4931.  A constant defining a RED color.
  4932. @\subsubsection{ROW}
  4933.   A constant defining the ROW direction of a surface or a trivariate mesh.
  4934. @\subsubsection{SGI}
  4935.  A constant designating an SGI system, in the MACHINE variable.
  4936. @\subsubsection{STRING\_TYPE}
  4937. !STRING_TYPE
  4938.  A constant defining an object of type string.
  4939. @\subsubsection{SURFACE\_TYPE}
  4940. !SURFACE_TYPE
  4941.  A constant defining an object of type surface.
  4942. @\subsubsection{SUN}
  4943.  A constant designating a SUN system, in the MACHINE variable.
  4944. @\subsubsection{TRIMSRF\_TYPE}
  4945. !TRIMSRF_TYPE
  4946.  A constant defining an object of type trimmed surface.
  4947. @\subsubsection{TRIVAR\_TYPE}
  4948. !TRIVAR_TYPE
  4949.  A constant defining an object of type trivariate function.
  4950. @\subsubsection{TRUE}
  4951. !TRUE
  4952.  A non zero constant. May be used as Boolean operand.
  4953. @\subsubsection{UNDEF\_TYPE}
  4954. !UNDEF_TYPE
  4955.  A constant defining an object of no type (yet).
  4956. @\subsubsection{UNIX}
  4957. !UNIX
  4958.  A constant designating a generic UNIX system, in the MACHINE variable.
  4959. @\subsubsection{VECTOR\_TYPE}
  4960. !VECTOR_TYPE
  4961.  A constant defining an object of type vector.
  4962. @\subsubsection{WHITE}
  4963. !WHITE
  4964.  A constant defining a WHITE color.
  4965. @\subsubsection{YELLOW}
  4966. !YELLOW
  4967.  A constant defining a YELLOW color.
  4968. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4969. @\section{Animation}
  4970. @\label{sec-animation}
  4971. !Animation
  4972.  The animation tool adds the capability of animating objects using
  4973.  forward kinematics, exploiting animation curves.  Each object has
  4974.  different attributes, that prescribe its motion, scale, and visibility
  4975.  as a function of time. Every attribute has a name, which designates
  4976.  it's role. For instance an attribute animation curve named MOV\_X
  4977.  describes a translation motion along the X axis.
  4978. @\subsection{How to create animation curves in IRIT}
  4979. !How to create animation curves in IRIT
  4980.  Let OBJ be an object in IRIT to animate.
  4981.  Animation curves are either scalar (E1/P1) curves or three dimensional
  4982.  (E3/P3) curves with one of the following names:
  4983. # 30 2 1 1
  4984.   MOV\_X, MOV\_Y, MOV\_Z
  4985.    Translation along one axis
  4986.   MOV\_XYZ
  4987.    Arbitrary translation along all three axes
  4988.   ROT\_X, ROT\_Y, ROT\_Z
  4989.    Rotating around a single axis (degrees)
  4990.   SCL\_X, SCL\_Y, SCL\_Z
  4991.    Scale along a single axis
  4992.   SCL
  4993.    Global scale
  4994.   VISIBLE
  4995.    Visibility
  4996.  The visibility curve is a scalar curve that enables the display of
  4997.  the object if the visibility curve is positive at time t and disables
  4998.  the display (hide) the object if the visibility curve is negative at
  4999.  time t.
  5000.  The animation curves are all attached as an attribute named "animation"
  5001.  to the object OBJ.
  5002.  Example:
  5003. @\begin{verbatim}
  5004.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  5005.                      ctlpt( E1, 1.0 ) );
  5006.     scl   = cbezier( ctlpt( E1, 1.0 ),
  5007.                      ctlpt( E1, 0.1 ) );
  5008.     rot_y = cbezier( ctlpt( E1, 0.0 ),
  5009.                      ctlpt( E1, 0.0 ) );
  5010.                      ctlpt( E1, 360.0 ) );
  5011.     attrib(OBJ, "animation", list( mov_x, scl, rot_y ) );
  5012. @\end{verbatim}
  5013.  To animate OBJ between time zero and one (Bezier curves are always
  5014.  between zero and one), by moving it a unit size in the X direction,
  5015.  scaling it to %10 of its original size and rotating it at increasing
  5016.  angular speed from zero to 360 degrees.
  5017.  OBJ can now be save into a file or displayed via one of the regular
  5018.  viewing commands in IRIT (i.e. VIEWOBJ).
  5019.  Animation is not always between zero and one. To that end one can
  5020.  apply the CREPARAM function to modify the parametric domain of the
  5021.  animation curve. The convention is that if the time is below the
  5022.  starting value of the parametric domain, the starting value of the
  5023.  curve is used.  Similarly if the time is beyond the end of the
  5024.  parameter domain of the animation curve, the end value of the
  5025.  animation curve is used.
  5026.  Example:
  5027. @\begin{verbatim}
  5028.     CREPARAM( mov_x, 3.0, 5.0 );
  5029. @\end{verbatim}
  5030.  to set the time of the motion in the x axis to be from $t = 3$ to
  5031.  $t = 5$.  for $t < 3$, mov\_x(3) is used, and for $t > 5$, mov\_x(5) is
  5032.  employed.
  5033.  the animation curves are regular objects in the IRIT system. Hence,
  5034.  only one object named mov\_x or scl can exist at one time. If you
  5035.  create a new object named mov\_x, the old one is overwritten! To
  5036.  preserve old animation curves you can detach the old ones by executing
  5037.  'free(mov\_x)' that removes the object named mov\_x from IRIT's object
  5038.  list but not from its previous used locations within other list
  5039.  objects, if any. For example:
  5040. @\begin{verbatim}
  5041.     mov_x = cbezier( ctlpt( E1, 0.0 ),
  5042.                      ctlpt( E1, 1.0 ) );
  5043.     attrib(obj1, "animation", list( mov_x ) );
  5044.     free(mov_x);
  5045.     mov_x = cbezier( ctlpt( E1, 2.0 ),
  5046.                      ctlpt( E1, 3.0 ) );
  5047.     attrib(obj2, "animation", list( mov_x ) );
  5048.     free(mov_x);
  5049. @\end{verbatim}
  5050. @\subsection{A more complete animation example}
  5051. !A more complete animation example
  5052. @\begin{verbatim}
  5053.   a = box( vector( 0, 0, 0 ), 1, 1, 1 );
  5054.   b = box( vector( 0, 0, 0 ), 1, 1, 1 );
  5055.   c = box( vector( 0, 0, 0 ), 1, 1, 1 );
  5056.   d = sphere( vector( 0, 0, 0), 0.7 );
  5057.   pt0   =  ctlpt( e1,  0.0 );
  5058.   pt1   =  ctlpt( e1,  1.0 );
  5059.   pt2   =  ctlpt( e1,  2.0 );
  5060.   pt6   =  ctlpt( e1,  6.0 );
  5061.   pt360 =  ctlpt( e1,  360.0 );
  5062.   pt10 = ctlpt( e1, -4.0 );
  5063.   pt11 = ctlpt( e1,  1.0 );
  5064.   pt12 = ctlpt( e1,  4.0 );
  5065.   pt13 = ctlpt( e1, -1.0 );
  5066.   visible = creparam( cbezier( list( pt10,  pt11 ) ), 0.0, 5.0 );
  5067.   mov_x   = creparam( cbezier( list( pt0, pt6, pt2 ) ), 0.0, 1.2 );
  5068.   mov_y   = mov_x;
  5069.   mov_z   = mov_x;
  5070.   rot_x   = creparam( cbspline( 2,
  5071.                                 list( pt0, pt360, pt0 ),
  5072.                                 list( KV_OPEN ) ),
  5073.                       1.2, 2.5 ); 
  5074.   rot_y   = rot_x;
  5075.   rot_z   = rot_x;
  5076.   scl     = creparam( cbezier( list( pt1, pt2, pt1, pt2, pt1 ) ),
  5077.                       2.5, 4.0 );
  5078.   scl_x   = scl;
  5079.   scl_y   = scl;
  5080.   scl_z   = scl;
  5081.   mov_xyz = creparam( circle( vector( 0, 0, 0 ), 2.0 ), 4.0, 5.0 );
  5082.   attrib( d, "animation", list( mov_xyz, visible ) );
  5083.   free( visible );
  5084.   visible = creparam( cbezier( list( pt12,  pt13 ) ), 0.0, 5.0 );
  5085.   attrib( a, "animation", list( rot_x, mov_x, scl, scl_x, visible ) );
  5086.   attrib( b, "animation", list( rot_y, mov_y, scl, scl_y, visible ) );
  5087.   attrib( c, "animation", list( rot_z, mov_z, scl, scl_z, visible ) );
  5088.   color( a, red );
  5089.   color( b, green );
  5090.   color( c, blue );
  5091.   color( d, cyan );
  5092.   demo = list( a, b, c, d );
  5093.   interact( demo );
  5094.   viewanim( 0, 5, 0.01 );
  5095. @\end{verbatim}
  5096.  In this example, we create four objects, three cubes and one sphere.
  5097.  Animation curves to translate the three cubes along the three axes for
  5098.  the time period of t = 0 to t = 1.2 are created. Rotation curves to
  5099.  rotate the three cubes along the three axes are then created for time
  5100.  period of t = 1.2 to t = 2.5. Finally, for the time period of t = 2.5
  5101.  to t = 4.0. the cubes are (not only) unifomly scaled. For the time
  5102.  period of t = 4 to t = 5, the cubes become invisible and the sphere,
  5103.  that becomes visible, is rotated along a circle of radius 2.
  5104. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5105. @\section{Display devices}
  5106. !Display devices
  5107.  The following display device drivers are available,
  5108. # 22 3 0 1
  5109.  Device Name
  5110.   Invocation
  5111.    Environment
  5112.  xgldrvs
  5113.   xgldrvs -s-
  5114.    SGI 4D GL regular driver.
  5115.  xogldrvs
  5116.   xogldrvs -s-
  5117.    SGI 4D Open GL/Motif driver.
  5118.  xgladap
  5119.   xgladap -s-
  5120.    SGI 4D GL adaptive isocurve
  5121.    experimental driver.
  5122.  x11drvs
  5123.   x11drvs -s-
  5124.    X11 driver.
  5125.  xmtdrvs
  5126.   xmtdrvs -s-
  5127.    X11 Motif driver.
  5128.  xglmdrvs
  5129.   xglmdrvs -s-
  5130.    SGI 4D GL and X11/Motif driver.
  5131.  wntdrvs
  5132.   wntdrvs -s-
  5133.    IBM PC Windows NT driver.
  5134.  wntgdrvs
  5135.   wntgdrvs -s-
  5136.    IBM PC Windows NT Open GL driver.
  5137.  os2drvs
  5138.   os2drvs -s-
  5139.    IBM PC OS2 2.x driver.
  5140.  amidrvs
  5141.   amidrvs -s-
  5142.    AmigaDOS 2.04+ driver.
  5143.  nuldrvs
  5144.   nuldrvs -s- [-d] [-D]
  5145.    A device to print the
  5146.    object stream to stdout.
  5147.  All display devices are clients communicating with the server ({\em IRIT})
  5148.  using IPC (inter process communication). On Unix and Window NT sockets are
  5149.  used. A Windows NT client can talk to a server ({\em IRIT}) on a unix host if
  5150.  hooked to the same netwrok. On OS2 pipes are used, and both the client and
  5151.  server must run on the same machine. On AmigaDOS exec messages are used,
  5152.  and both the client and server must run on the same machine.
  5153.    The server ({\em IRIT}) will automatically start a client display device
  5154.  if the IRIT\_DISPLAY environment variable is set to the name and options of
  5155.  the display device to run. For example:
  5156. @\begin{verbatim}
  5157.     setenv IRIT_DISPLAY xgldrvs -s-
  5158. @\end{verbatim}
  5159.    The display device must be in a directory that is in the {\bf path}
  5160.  environment variable. Most display devices require the '-s-' flags to run
  5161.  in a non-standalone mode, or a client-server mode. Most drivers can also
  5162.  be used to display data in a standalone mode (i.e., no server). For
  5163.  example:
  5164. @\begin{verbatim}
  5165.     xgldrvs -s solid1.dat irit.mat
  5166. @\end{verbatim}
  5167.     Effectively, all the display devices are also data display programs
  5168.  (poly3d, which was the display program prior to version 4.0, is retired
  5169.  in 4.0). Therefore some functionality is not always as expected. For
  5170.  example, the quit button will always force the display device to quit,
  5171.  even if poped up from {\em IRIT}, but will not cause {\em IRIT} to
  5172.  quit as might logically expected. In fact, the next time {\em IRIT} will
  5173.  try to communicate with the display device, it will find the broken
  5174.  connection and will start up a new display device.
  5175.     Most display devices recognize attributes found on objects. The following
  5176.  attributes are usually recognized (depending on the device capability.):
  5177. @\begin{itemize}
  5178. @\item
  5179.   {\bf COLOR}: Selects the drawn color of the object to be one of the 8/16
  5180.         predefined colors in the {\em IRIT} system: white, red, green, blue,
  5181.         yellow, cyan, magenta, black.
  5182.   {\bf RGB}: Overwrites (if supported) the COLOR attribute (if given) and
  5183.         sets the color of the object to the exact prescribed RGB set.
  5184.   {\bf DWIDTH}: Sets the width in pixels of the drawn object, when drawn as
  5185.         a wireframe.
  5186. @\end{itemize}
  5187.     All display devices recognize all the command line flags and all the
  5188.  configuration options in a configuration file, as described below. The display
  5189.  devices will make attemps to honor the requests, to the best of their ability.
  5190.     For example, only xgldrvs can render shaded models, and so only it will
  5191.  honor a {\bf DrawSolid} configuration options.
  5192. @\subsection{Command Line Options}
  5193. !Command Line Options
  5194. @\begin{verbatim}
  5195.  ???drvs [-s] [-u] [-n] [-N] [-i] [-c] [-C] [-m] [-a] [-g x1,x2,y1,y2]
  5196.          [-G x1,x2,y1,y2] [-I #IsoLines] [-F PolygonOpti FineNess] 
  5197.          [-f PolylineOpti SampPerCrv] [-l LineWidth] [-r] [-B] [-2]
  5198.          [-d] [-D] [-L NormalLen] [-4] [-b BackGround] [-S LgtSrcPos]
  5199.          [-Z ZMin ZMax] [-M] [-P] [-x ExecAnim] [-z] DFiles
  5200. @\end{verbatim}
  5201. @\begin{itemize}
  5202. @\item
  5203.   {\bf -s}: Runs the driver in a Standalone mode. Otherwise, the driver will
  5204.         attempt to communicate with the {\em IRIT} server.
  5205. @\item
  5206.   {\bf -u}: Forces a Unit matrix. That is, input data are {\em not}
  5207.         transformed at all.
  5208. @\item
  5209.   {\bf -n}: Draws normals of vertices.
  5210. @\item
  5211.   {\bf -N}: Draws normals of polygons.
  5212. @\item
  5213.   {\bf -i}: Draws internal edges (created by {\em IRIT}) - default is not to
  5214.         display them, and this option will force displaying them as well.
  5215. @\item
  5216.   {\bf -c}: Sets depth cueing on. Drawings that are closer to the viewer will
  5217.         be drawn in more intense color.
  5218. @\item
  5219.   {\bf -C}: Cache the piecewise linear geometry so curves and surface can
  5220.         be redisplay faster. Purging it will free memory, on the other hand.
  5221. @\item
  5222.   {\bf -m}: Provides some more information on the data file(s) parsed.
  5223. @\item
  5224.   {\bf -a}: Sets the support of antialiased lines.
  5225. @\item
  5226.   {\bf -g x1,x2,y1,y2}: Prescribes the position and location of the
  5227.         transformation window by prescribing the domain of the window in
  5228.         screen space pixels.
  5229. @\item
  5230.   {\bf -G x1,x2,y1,y2}: Prescribes the position and location of the
  5231.         viewing window by prescribing the domain of the window in
  5232.         screen space pixels.
  5233. @\item
  5234.   {\bf -I \#IsoLines}: Specifies number of isolines per surface, per direction.
  5235.         A specification of zero isolines is possible only on the command line
  5236.         and it denotes the obvious.
  5237. @\item
  5238.   {\bf -F PolyOpti FineNess}: Controls the method used to approximate surfaces
  5239.         into polygons. See the variable POLY\_APPROX\_OPT for the meaning of
  5240.         FineNess. See also -4.
  5241. @\item
  5242.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  5243.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  5244.         Otherwise, an adaptive subdivision that optimizes the samples is
  5245.         employed.
  5246. @\item
  5247.   {\bf -l LineWidth}: Sets the linewidth, in pixels. Default is one pixel wide.
  5248. @\item
  5249.   {\bf -r}: Rendered mode. Draws object as solid.
  5250. @\item
  5251.   {\bf -B}: Back face culling of polygons.
  5252. @\item
  5253.   {\bf -2}: Double buffering. Prevents screen flicker on the expense of
  5254.         possibly less colors.
  5255. @\item
  5256.   {\bf -d}: Debug objects. Prints to stderr all objects read from communcation
  5257.         port with the server {\em IRIT}. 
  5258. @\item
  5259.   {\bf -D}: Debug input. Prints to stderr all characters read from communcation
  5260.         port with the server {\em IRIT}. Lowest level of communication.
  5261. @\item
  5262.   {\bf -L NormalLen}: Sets the length of the drawn normals in thousandths of
  5263.         a unit.
  5264. @\item
  5265.   {\bf -4}: Forces four polygons per almost flat region in the surface to
  5266.         polygon conversion. Otherwise two polygons only.
  5267. @\item
  5268.   {\bf -b BackGround}: Sets the background color as three RGB integers in the
  5269.         range of 0 to 255.
  5270. @\item
  5271.   {\bf -S LgtSrcPos}: Sets the lighting via the light source position.
  5272. @\item
  5273.   {\bf -Z ZMin ZMax}: Sets the near and far Z clipping planes.
  5274. @\item
  5275.   {\bf -M}: Draw control mesh/polygon of curves and surfaces, as well.
  5276. @\item
  5277.   {\bf -x ExecAnim}: Command to execute as a subprocess every iteration of
  5278.         display of an animation sequence. This command can for example save
  5279.         the display into an image file, saving the animation sequence.
  5280.         One parameter is passed, which is an running index starting from one.
  5281. @\item
  5282.   {\bf -P}: Draws curves and surfaces (surfaces are drawn using a set of
  5283.         isocurves, see -I, or polygons, see -f).
  5284. @\item
  5285.   {\bf -z}: Prints version number and current defaults.
  5286. @\end{itemize}
  5287. @\subsection{Configuration Options}
  5288. !Configuration Options
  5289.  The configuration file is read {\em before} the command line options are
  5290.  processed. Therefore, all options in this section can be overriden
  5291.  by the appropriate command line option, if any.
  5292. @\begin{itemize}
  5293. @\item
  5294.   {\bf TransPrefPos:} Preferred location (Xmin, YMin, Xmax, Ymax) of the
  5295.         transformation window.
  5296. @\item
  5297.   {\bf ViewPrefPos:} Preferred location (Xmin, YMin, Xmax, Ymax) of the
  5298.         viewing window.
  5299. @\item
  5300.   {\bf BackGround:} Background color. Same as '-b'.
  5301. @\item
  5302.   {\bf Internal:} Draws internal edges. Same as '-i'.
  5303. @\item
  5304.   {\bf DrawVNormal:} Draws normals of vertices. Same as '-n'.
  5305. @\item
  5306.   {\bf DrawPNormal:} Draws normals of polygons. Same as '-n'.
  5307. @\item
  5308.   {\bf MoreVerbose:} Provides some more information on the data file(s)
  5309.         parsed. Same as '-m'.
  5310. @\item
  5311.   {\bf UnitMatrix:} Forces a Unit matrix. That is, input data are {\em not}
  5312.         transformed at all. Same as '-u'.
  5313. @\item
  5314.   {\bf DrawSolid:} Requests a shaded surface rendering, as opposed to isocurve
  5315.         surface representation.
  5316. @\item
  5317.   {\bf BFaceCull:} Requests the removal of back facing polygons, for better
  5318.         visibility.
  5319. @\item
  5320.   {\bf DoubleBuffer:} Requests drawing using a double buffer, if any.
  5321. @\item
  5322.   {\bf NumOfIsolines:}  Specifies number of isolines per surface, per
  5323.         direction. Same as '-I'.
  5324. @\item
  5325.   {\bf SamplesPerCurve:} Specifies the samples per (iso)curve. See '-f'.
  5326. @\item
  5327.   {\bf PolylineOpti:} Controls the method used to subdivide a curve into
  5328.         polylines that approximate it. See '-f'.
  5329. @\item
  5330.   {\bf LineWidth:} Sets the linewidth, in pixels. Default is one pixel
  5331.        wide. Same as '-l'
  5332. @\item
  5333.   {\bf AdapIsoDir:} Selects the direction of the adaptive isoline
  5334.         rendering.
  5335. @\item
  5336.   {\bf FineNess:} Controls the fineness of the surface to polygon subdivision.
  5337.         See '-F'.
  5338. @\item
  5339.   {\bf PolygonOpti:} Controls the method used to subdivide a surface into
  5340.         polygons that approximate it. See '-F'.
  5341. @\item
  5342.   {\bf DepthCue:} Set depth cueing on. Drawings that are closer to the
  5343.         viewer will be drawn in more intense color. Same as '-c'.
  5344. @\item
  5345.   {\bf FourPerFlat:} Forces four polygons per almost flat region in the
  5346.         surface to polygon conversion. Otherwise two polygons only. Same as
  5347.         '-4'.
  5348. @\item
  5349.   {\bf AntiAlias:} Request the drawing of anti aliased lines.
  5350. @\item
  5351.   {\bf DrawSurfaceMesh:} Draws control mesh/polygon of curves and surfaces,
  5352.         as well. Same as '-M'.
  5353. @\item
  5354.   {\bf DrawSurfacePoly:} Draws curves and surfaces (surfaces are drawn using
  5355.         a set of isocurves, see -I, or polygons, see -f). Same as '-P'.
  5356. @\item
  5357.   {\bf StandAlone:} Runs the driver in a Stand alone mode. Otherwise, the
  5358.         driver will attempt to communicate with the {\em IRIT} server. Same
  5359.         as '-s'.
  5360. @\item
  5361.   {\bf TransMode:} Selects between object space transformations and screen
  5362.         space transformation.
  5363. @\item
  5364.   {\bf ViewMode:} Selects between perspective and orthographic views.
  5365. @\item
  5366.   {\bf NormalLength:} Sets the length of the drawn normals in thousandths of
  5367.         a unit. Same as '-L'.
  5368. @\item
  5369.   {\bf DebugObjects:} Debug objects. Prints to stderr all objects read
  5370.         from the communcation port with the server {\em IRIT}. Same as '-d'.
  5371. @\item
  5372.   {\bf DebugEchoInput:} Debug input. Prints to stderr all characters read
  5373.         from the communcation port with the server {\em IRIT}. Lowest level of
  5374.         communications.
  5375. @\item
  5376.   {\bf LightSrcPos:} Sets the location of the (first) light source as a rational
  5377.         four coefficient location. W of zero sets the light source at infinity.
  5378. @\end{itemize}
  5379. @\subsection{Interactive mode setup}
  5380. !Interactive mode setup
  5381.    Commands that affect the status of the display device can also be sent
  5382.  via the communication port with the {\em IRIT} server. The following commands
  5383.  are recognized as string objects with object name of "COMMAND\_":
  5384. # 20 2 0 1
  5385.  {\bf BEEP}
  5386.   Makes some sound.
  5387.  {\bf CLEAR}
  5388.   Clears the display area. All objects are deleted.
  5389.  {\bf DCLEAR}
  5390.   Delayed clear. Same as CLEAR but delayed until next
  5391.   object is sent from the server. Useful for animation.
  5392.  {\bf DISCONNECT}
  5393.   Closes connection with the server, but does not quit.
  5394.  {\bf EXIT}
  5395.   Closes connection with the server and quits.
  5396.  {\bf GETOBJ NAME}
  5397.   Requests the object named NAME that is returned in the
  5398.   output channel to the server.
  5399.  {\bf MSAVE NAME}
  5400.   Saves the transformation matrix file by the name NAME.
  5401.  {\bf REMOVE NAME}
  5402.   Request the removal of object named NAME from display.
  5403.  {\bf ANIMATE TMin TMax Dt}
  5404.   Animates current scene from TMin to TMax in Dt steps.
  5405.  {\bf STATE COMMAND}
  5406.   Changes the state of the display device. See below.
  5407.    The following commands are valid for the STATE COMMAND above,
  5408. # 16 2 0 1
  5409.  {\bf MoreSense:}
  5410.    More sensitive mouse control.
  5411.  {\bf LessSense:}
  5412.    Less sensitive mouse control.
  5413.  {\bf ScrnObject:}
  5414.    Toggle screen/object transformation mode.
  5415.  {\bf PerspOrtho:}
  5416.    Toggles perspective/orthographic trans. mode.
  5417.  {\bf DepthCue:}
  5418.    Toggles depth cueing drawing.
  5419.  {\bf DrawSolid:}
  5420.    Toggles isocurve/shaded solid drawing.
  5421.  {\bf BFaceCull:}
  5422.    Cull back facing polygons.
  5423.  {\bf DblBuffer:}
  5424.    Toggles single/double buffer mode.
  5425.  {\bf AntiAlias:}
  5426.    Toggles anti aliased lines.
  5427.  {\bf DrawIntrnl:}
  5428.    Toggles drawing of internal lines.
  5429.  {\bf DrawVNrml:}
  5430.    Toggles drawing of normals of vertices.
  5431.  {\bf DrawPNrml:}
  5432.    Toggles drawing of normals of polygons.
  5433.  {\bf DSrfMesh:}
  5434.    Toggles drawing of control meshes/polygons.
  5435.  {\bf DSrfPoly:}
  5436.    Toggles drawing of curves/surfaces.
  5437.  {\bf 4PerFlat:}
  5438.    Toggles 2/4 polygons per flat surface regions.
  5439.  {\bf MoreIso:}
  5440.    Doubles the number of isolines in a surface.
  5441.  {\bf LessIso:}
  5442.    Halves the number of isolines in a surface.
  5443.  {\bf FinrAprx:}
  5444.    Doubles the number of samples per curve.
  5445.  {\bf CrsrAprx:}
  5446.    Halves the number of samples per curve.
  5447.  {\bf LngrVecs:}
  5448.    Doubles the length of displayed normal vectors.
  5449.  {\bf ShrtrVecs:}
  5450.    Halves the length of displayed normal vectors.
  5451.  {\bf WiderLns:}
  5452.    Doubles the width of the drawn lines.
  5453.  {\bf NarrwLns:}
  5454.    Halves the width of the drawn lines.
  5455.  {\bf FinrAdapIso:}
  5456.    Doubles the number of adaptive isocurves.
  5457.  {\bf CrsrAdapIso:}
  5458.    Halves the number of adaptive isocurves.
  5459.  {\bf FinerRld:}
  5460.    Doubles number of ruled surfaces in adaptive isocurves.
  5461.  {\bf CrsrRld:}
  5462.    Halves number of ruled surfaces in adaptive isocurves.
  5463.  {\bf RuledSrfApx:}
  5464.    Toggles ruled surface approx. in adaptive isocurves.
  5465.  {\bf AdapIsoDir:}
  5466.    Toggles the row/col direction of adaptive isocurves.
  5467.  {\bf Front:}
  5468.    Selects a front view.
  5469.  {\bf Side:}
  5470.    Selects a side view.
  5471.  {\bf Top:}
  5472.    Selects a top view.
  5473.  {\bf Isometry:}
  5474.    Selects an isometric view.
  5475.  {\bf Clear:}
  5476.    Clears the viewing area.
  5477.  Obviously not all state options are valid for all drivers.
  5478.    The {\em IRIT} server defines in iritinit.irt several user-defined
  5479.  functions that exercise some of the above state commands, such as
  5480.  VIEWSTATE and VIEWSAVE.
  5481.    In addition to state modification via communication with the {\em IRIT}
  5482.  server, modes can be interactively modified on most of the display devices
  5483.  using a pop-up menu that is activated using the {\em right button in the
  5484.  transformation window}.
  5485.    This pop up menu is somewhat different in different drivers, but its
  5486.  entries closely follow the entries of the above state command table.
  5487. @\subsection{Animation Mode}
  5488. !Animation Mode
  5489.    All the display drivers are now able to animate objects with animation
  5490.  curves' attributes on them. For more on the way animation curves can be
  5491.  created see the Animation Section of this manual
  5492. @(Section~\ref{sec-animation}).
  5493.    Once a scene with animation curves' attributes is being loaded into
  5494.  a display device, one can enter "animation" mode using the "Animation"
  5495.  button available in all display devices. The user is then prompt (either
  5496.  graphically or in a textual based interface) for the starting time,
  5497.  termination time and step size of the animation. The parameter space of
  5498.  the animation curve is serving as the time domain. The default staring
  5499.  and terminating times are set as the minimal and maximal parametric
  5500.  domain values of all animation curves. An object at time t below the
  5501.  minimal parametric value will be placed at the starting value of the
  5502.  animation curve. Similarly, an object at time t above the
  5503.  maximal parametric value will be placed at the termination value of the
  5504.  animation curve. The user can also set a bouncing back and forth mode,
  5505.  the number of repetitions, and if desired, request the saving of all
  5506.  the different scenes in the animation as seperate files so a high quality
  5507.  animation can be created.
  5508. @\subsection{Specific Comments}
  5509. !Specific Comments
  5510. @\begin{itemize}
  5511. @\item
  5512.    The x11drvs supports the following X Defaults (searched at ~/.Xdefaults):
  5513. @\begin{verbatim}
  5514.         #ifndef COLOR
  5515.         irit*MaxColors:                    1
  5516.         irit*Trans*BackGround:             Black
  5517.         irit*Trans*BorderColor:            White
  5518.         irit*Trans*TextColor:              White
  5519.         irit*Trans*SubWin*BackGround:      Black
  5520.         irit*Trans*SubWin*BorderColor:     White
  5521.         irit*Trans*CursorColor:            White
  5522.         irit*View*BackGround:              Black
  5523.         irit*View*BorderColor:             White
  5524.         irit*View*CursorColor:             White
  5525.         #else
  5526.         irit*MaxColors:                    15
  5527.         irit*Trans*BackGround:             NavyBlue
  5528.         irit*Trans*BorderColor:            Red
  5529.         irit*Trans*TextColor:              Yellow
  5530.         irit*Trans*SubWin*BackGround:      DarkGreen
  5531.         irit*Trans*SubWin*BorderColor:     Magenta
  5532.         irit*Trans*CursorColor:            Green
  5533.         irit*View*BackGround:              NavyBlue
  5534.         irit*View*BorderColor:             Red
  5535.         irit*View*CursorColor:             Red
  5536.         #endif
  5537.         irit*Trans*BorderWidth:            3
  5538.         irit*Trans*Geometry:               =150x500+510+0
  5539.         irit*View*BorderWidth:             3
  5540.         irit*View*Geometry:                =500x500+0+0
  5541. @\end{verbatim}
  5542. @\item
  5543.  The Motif-based display drivers contain three types of gadgets which can be
  5544.  operated in the following manner. Scales: can be dragged or clicked outside
  5545.  button for single (mouse's middle button) or continuous (mouse's left
  5546.  button) action. Pushbuttons: activated by clicking the mouse's left button.
  5547.  The control panel: allowes rotation, translation of the objects in three
  5548.  axes, determine perspective ratio, viewing object from top, side, front or
  5549.  isometrically, determining scale factor and clipping settings, and operate
  5550.  the matrix stack. 
  5551.    The environment window toggles between screen/object translation, depth
  5552.  cue on/off, orthographic/perspective projection, wireframe/solid display,
  5553.  single/doubble buffering,  showing/hiding normals, including/excluding
  5554.  surface mesh, surface isolines/polygons, and four/two per flat. Xglmdrvs
  5555.  allowes inclusion/exclusion of internal edges, and in xmtdrvs pro/anti
  5556.  aliasing. Scales set normals length, lines width, buttons sensitivity,
  5557.  the number of islolines and samples.
  5558. @\item
  5559.    The locations of windows as set via [-g] and [-G] and/or via the
  5560.  configuration file overwrites in x11drvs the Geometry X11 defaults.
  5561.  To use the Geometry X11 default use '-G " "' and '-g " "' or set the
  5562.  string to empty size in the configuration file.
  5563. @\item
  5564.    In os2drvs, only -G is used to specify the dimensions of the parent window
  5565.  that holds both the viewing and the transformation window.
  5566. @\end{itemize}
  5567. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5568. @\section{Utilities - General Usage}
  5569. !Utilities - General Usage
  5570.    The {\em IRIT} solid modeler is accompanied by quite a few utilities. They
  5571.  can be subdivided into two major groups. The first includes auxiliary tools
  5572.  such as illustrt and poly3d-h. The second includes filters such as irit2ray
  5573.  and irit2ps.
  5574.    All these tools operate on input files, and most of the time produce
  5575.  data files. In all utilities that read files, the dash ('-') can be used
  5576.  to read stdin.
  5577.  Example:
  5578. @\begin{verbatim}
  5579.  poly3d-h solid1.dat | irit2ps - > solid1.ps
  5580. @\end{verbatim}
  5581.    All the utilities have command line options. If an option is set by a '-x'
  5582.  then '-x-' resets the option. The command line options overwrite the settings
  5583.  in config files, and the reset option is useful for cases where the option
  5584.  is set by default, in the configuration file.
  5585.    All utilities can read a sequence of data files. However, the {\em last}
  5586.  transformation matrices found (VIEW\_MAT and PRSP\_MAT) are actually used.
  5587.  Example:
  5588. @\begin{verbatim}
  5589.  poly3d-h solid1.dat | x11drvs solid1.dat - solid1.mat 
  5590. @\end{verbatim}
  5591.  x11drvs will display the original solid1.dat file with its hidden version,
  5592.  as computed by poly3d-h, all with the solid1.mat, ignoring all other matrices
  5593.  in the data stream.
  5594.  Under unix, compressed files with a postfix ".Z" will be {\em automatically}
  5595.  uncompressed on read and write. The following is legal under unix,
  5596. @\begin{verbatim}
  5597.  poly3d-h solid1.dat.Z | x11drvs solid1.dat.Z - solid1.mat
  5598. @\end{verbatim}
  5599.  where solid1.dat.Z was saved from within IRIT using the command
  5600. @\begin{verbatim}
  5601.  save( "solid1.dat.Z", solid1 );
  5602. @\end{verbatim}
  5603.  or similar. The unix system's "compress" and "zcat" are used for the purpose
  5604.  of (un)compressing the data via pipes. See also SAVE and LOAD.
  5605. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5606. @\section{poly3d-h - Hidden Line Removing Program}
  5607. !poly3d-h - Hidden Line Removing Program
  5608. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5609. @\subsection{Introduction}
  5610. &Introduction
  5611.     poly3d-h is a program to remove hidden lines from a given polygonal model.
  5612.  Freeform objects are preprocessed into polygons with controlled fineness.
  5613. @See Figure~\ref{fig-poly3dh} for some output examples of using this tool.
  5614. @\begin{figure}
  5615. @\vspace{4.3in}
  5616. @\special{psfile=user_man/solid2h.ps hscale=50 vscale=50 hoffset=-20 voffset=50}
  5617. @\special{psfile=user_man/molecule.ps hscale=50 vscale=50 hoffset=130 voffset=-40}
  5618. @\special{psfile=user_man/dodechdr.ps hscale=50 vscale=50 hoffset=240 voffset=80}
  5619. @\caption{Some examples of the use of hidden line removal tool poly3d-h to
  5620. @         remove hidden lines.}
  5621. @\label{fig-poly3dh}
  5622. @\end{figure}
  5623.     The program performs 4 passes over the input:
  5624.  1. Preprocesses and maps all polygons in a scene, and sorts them.
  5625.  2. Generates edges out of the polygonal model and sorts them (preprocessing
  5626.     for the scan line algorithm) into buckets.
  5627.  3. Intersects edges, and splits edges with non-homogeneous visibility (the
  5628.     scan line algorithm).
  5629.  4. Applies a visibility test of each edge.
  5630.         This program can handle CONVEX polygons only. From {\em IRIT} one can
  5631.  ensure that a model consists of convex polygons only using the CONVEX command:
  5632. @\begin{verbatim}
  5633.   CnvxObj = convex( Obj );
  5634. @\end{verbatim}
  5635.  just before saving it into a file. Surfaces are always decomposed into
  5636.  triangles.
  5637.     poly3d-h output is in the form of polylines. It is a regular {\em IRIT} data
  5638.  file that can be viewed using any of the display devices, for example.
  5639. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5640. @\subsection{Command Line Options}
  5641. &Command line options
  5642. @\begin{verbatim}
  5643.  poly3d-h [-b] [-m] [-i] [-e #Edges] [-H] [-4] [-W Width]
  5644.         [-F PolyOpti FineNess] [-q] [-o OutName] [-c] [-z] DFiles > OutFile
  5645. @\end{verbatim}
  5646. @\begin{itemize}
  5647. @\item
  5648.   {\bf -b}: BackFacing - if an object is closed (such as most models created by
  5649.        {\em IRIT}), back facing polygons can be deleted, therefore speeding up
  5650.        the process by at least a factor of two.
  5651. @\item
  5652.   {\bf -m}: More - provides some more information on the data file(s) parsed.
  5653. @\item
  5654.   {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to
  5655.        display them, and this option will force displaying them as well.
  5656. @\item
  5657.   {\bf -e n}: Number of edges to use from each given polygon (default all).
  5658.        Handy as '-e 1 -4' for freeform data.
  5659. @\item
  5660.   {\bf -H}: Dumps both visible lines and hidden lines as separated objects.
  5661.        Hidden lines will be dumped using a different (dimmer) color and (a
  5662.        narrower) line width.
  5663. @\item
  5664.   {\bf -4}: Forces four polygons per almost flat region in the surface to
  5665.        polygon conversion. Otherwise two polygons only.
  5666. @\item
  5667.   {\bf -W Width}: Selects a default width for visible lines in inches.
  5668. @\item
  5669.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  5670.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  5671.        FineNess. See also -4.
  5672. @\item
  5673.   {\bf -q}: Quiet mode. No printing aside from fatal errors. Disables -m.
  5674. @\item
  5675.   {\bf -o OutName}: Name of output file. Default is stdout.
  5676. @\item
  5677.   {\bf -z}: Prints version number and current defaults.
  5678. @\item
  5679.   {\bf -c}: Clips data to screen (default). If disabled ('-c-'), data
  5680.        outside the view screen ([-1, 1] in x and y) are also processed.
  5681. @\end{itemize}
  5682.    Some of the options may be turned on in poly3d-h.cfg. They can be then
  5683.  turned off in the command line as '-?-'.
  5684. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5685. @\subsection{Configuration}
  5686. &Configuration
  5687.    The program can be configured using a configuration file named poly3d-h.cfg.
  5688.    This is a plain ASCII file you can edit directly and set the parameters
  5689.  according to the comments there. 'poly3d-h -z' will display the current
  5690.  configuration as read from the configuration file.
  5691.    The configuration file is searched in the directory specified by the
  5692.  IRIT\_PATH environment variable. For example,
  5693.  'setenv IRIT\_PATH /u/gershon/irit/bin/'.
  5694.    If the IRIT\_PATH variable is not set, the current directory is searched.
  5695. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5696. @\subsection{Usage}
  5697. &Usage
  5698.    As this program is not interactive, usage is quite simple, and the only
  5699.  control available is using the command line options.
  5700. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5701. @\section{poly3d-r - A Simple Data Rendering Program}
  5702. !poly3d-r - A Simple Data Rendering Program
  5703.  Retired. Sources can be found in the contrib directory, but this program is
  5704.  no longer supported. A new renderer is expected soon.
  5705. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5706. @\section{Illustrt - Simple line illustration filter}
  5707. !Illustrt - Simple line illustration filter
  5708. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5709. @\subsection{Introduction}
  5710. &Introduction
  5711.  illustrt is a filter that processes IRIT data files and dumps out modified
  5712.  IRIT data files. illustrt can be used to make simple nice illustrations of
  5713.  data. The features of illustrt include depth sorting, hidden line clipping 
  5714.  at intersection points, and vertex enhancements. illustrt is designed to
  5715.  closely interact with irit2ps, although it is not neceessary to use irit2ps
  5716.  on illustrt output.
  5717. @See Figure~\ref{fig-illustrt} for some output examples of using this tool.
  5718. @\begin{figure}
  5719. @\vspace{3in}
  5720. @\special{psfile=user_man/solid1.ps hscale=50 vscale=50 hoffset=0 voffset=-50}
  5721. @\special{psfile=user_man/icosahdr.ps hscale=50 vscale=50 hoffset=220 voffset=-50}
  5722. @\caption{Some examples of the use of the illustration tool illustrt.}
  5723. @\label{fig-illustrt}
  5724. @\end{figure}
  5725. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5726. @\subsection{Command Line Options}
  5727. &Command line options
  5728. @\begin{verbatim}
  5729.    illustrt [-I #IsoLines] [-S #SampPerCrv] [-s] [-M] [-P] [-p]
  5730.             [-l MaxLnLen] [-a] [-t TrimInter] [-o OutName] [-Z InterSameZ]
  5731.             [-m] [-z] DFiles
  5732. @\end{verbatim}
  5733. @\begin{itemize}
  5734. @\item
  5735.   {\bf -I \#IsoLines}: Specifies number of isolines per surface, per direction.
  5736. @\item
  5737.   {\bf -S \#SampPerCrv}: Specifies the samples per (iso)curve.
  5738. @\item
  5739.   {\bf -s}: sorts the data in Z depth order that emulates hidden line removal
  5740.         once the data are drawn.
  5741. @\item
  5742.   {\bf -M}: Dumps the control mesh/polygon as well.
  5743. @\item
  5744.   {\bf -P}: Dumps the curve/surface as isocurves.
  5745. @\item
  5746.   {\bf -p}: Dumps vertices of polygons/lines as points.
  5747. @\item
  5748.   {\bf -l MaxLnLen}: breaks long lines into shorter ones with maximal length
  5749.         of MaxLnLen. This option is necessary to achieve good depth depending
  5750.         line width in the '-d' option of irit2ps.
  5751. @\item
  5752.   {\bf -a}: takes into account the angle between the two (poly)lines that
  5753.         intersect when computing how much to trim. See also -t.
  5754. @\item
  5755.   {\bf -t TrimInter}: Each time two (poly)line segments intersect in the
  5756.         projection plane, the (poly)line that is farther away from the
  5757.         viewer is clipped TrimInter amount from both sides. See also -a.
  5758. @\item
  5759.   {\bf -o OutName}: Name of output file. Default is stdout.
  5760. @\item
  5761.   {\bf -Z InterSameZ}: The maximal Z depth difference of intersection curves
  5762.         to be be considered invalid.
  5763. @\item
  5764.   {\bf -m}: More talkative mode. Prints processing information.
  5765. @\item
  5766.   {\bf -z}: Prints version number and current defaults.
  5767. @\end{itemize}
  5768. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5769. @\subsection{Usage}
  5770. &Usage
  5771.     illustrt is a simple line illustration tool. It process geometry such
  5772.  as polylines and surfaces and dumps geometry with attributes that will make
  5773.  nice line illustrations. illustrt is geared mainly toward its use with
  5774.  irit2ps to create postscript illustrations. Here is a simple example:
  5775. @\begin{verbatim}
  5776.  illustrt -s -l 0.1 solid1.dat | irit2ps -W 0.05 -d 0.2 0.6 -u - > solid.ps
  5777. @\end{verbatim}
  5778.  make sure all segments piped into irit2ps are shorter than 0.1 and sort them
  5779.  in order to make sure hidden surface removal is correctly applied. Irit2ps
  5780.  is invoked with depth cueing activated, and a default width of 0.05.
  5781.     illustrt dumps out regular {\em IRIT} data files, so output can be handled
  5782.  like any other data set. illustrt does the following processing to the input
  5783.  data set:
  5784. @\begin{itemize}
  5785. @\item
  5786.   Converts surfaces to isocurves ('-I' flag) and isocurves and curves to
  5787.   polylines ('-S' flag), and converts polygons to polylines.
  5788.     Polygonal objects are considered closed and even though each edge is
  5789.   shared by two polygons, only a single one is generated.
  5790. @\item
  5791.   Finds the intersection location in the projection plane of all segments in
  5792.   the input data set and trims away the far segment at both sides of the
  5793.   intersection point by an amount controlled by the '-t' and '-a' flags.
  5794. @\item
  5795.   Breaks polylines and long lines into short segments, as specified via the
  5796.   '-l' flag, so that width depth cueing can be applied more accurately
  5797.   (see irit2ps's '-d' flag) as well as the Z sorting.
  5798. @\item
  5799.   Generates vertices of polygons in the input data set as points in output data
  5800.   controlled via the '-p' flag.
  5801.   set.
  5802. @\item
  5803.   Applies a Z sort to the output data, if '-s', so drawing in order of the data
  5804.   will produce a properly hidden surface removal drawing.
  5805. @\end{itemize}
  5806.  Here is a more complex example. Make sure tubular is properly set via
  5807.  "attrib(solid1, "tubular", 0.7);" and invoke:
  5808. @\begin{verbatim}
  5809.  illustrt -s -p -l 0.1 -t 0.05 solid1.dat |
  5810.      irit2ps -W 0.05 -d 0.2 0.6 -p h 0.05 -u - > solid.ps
  5811. @\end{verbatim}
  5812.  makes sure all segments piped into irit2ps are shorter than 0.1, generates
  5813.  points for the vertices, sorts the data in order to make sure hidden surface
  5814.  removal is correctly applied, and trims the far edge by 0.05 at an
  5815.  intersection point. Irit2ps is invoked with depth cueing activated and a
  5816.  default width of 0.05, points are drawn as hollowed circles of default
  5817.  size 0.05, and lines are drawn tubular.
  5818.  Objects in the input stream that have an attribute by the name of
  5819.  "IllustrtNoProcess" are passed to the output unmodified.
  5820.    Objects in the input stream that have an attribute by the name of
  5821.  "SpeedWave" will have a linear segments added that emulate fast
  5822.  motion with the following attributes
  5823.  "Randomness,DirX,DirY,DirZ,Length,Distance,LengthRandom,DistanceRandom,Width"
  5824.    Objects in the input stream that have an attribute by the name of
  5825.  "HeatWave" will have a spiral curves added that emulate a heat wave
  5826.  in the +Z axis with the following attributes
  5827.  "Randomness,Length,Distance,LengthRandom,DistanceRandom,Width".
  5828.  Examples:
  5829. @\begin{verbatim}
  5830.  attrib(Axis, "IllustrtNoProcess", "");
  5831.  attrib(Obj, "SpeedWave", "0.0005,1,0,0,5,3,3,2,0.05");
  5832.  attrib(Obj, "HeatWave", "0.015,0.1,0.03,0.06,0.03,0.002");
  5833. @\end{verbatim}
  5834. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5835. @\section{Dat2Bin - Data To Binary Data file filter}
  5836. !DAT2BIN - Data To Binary Data file filter
  5837. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5838. @\subsection{Command Line Options}
  5839. &Command line options
  5840. @\begin{verbatim}
  5841.    dat2bin [-t] [-z] DFiles
  5842. @\end{verbatim}
  5843. @\begin{itemize}
  5844. @\item
  5845.   {\bf -t}: Dumps data to stdout as text instead of binary.
  5846.   {\bf -z}: Print version number and current defaults.
  5847. @\end{itemize}
  5848. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5849. @\subsection{Usage}
  5850. &Usage
  5851.     It may be sometimes desired to convert .dat data files into a binary form,
  5852.  for example, for fast loading of files with large geometry. Binary files can
  5853.  be somewhat larger, are unreadable in editors but are much faster to load in.
  5854.  A binary file must have a '.bdt' file type.
  5855.  Example:
  5856. @\begin{verbatim}
  5857.    dat2bin b58polys.dat > b58polys.bdt
  5858.    dat2bin -t b58polys.bdt | more
  5859. @\end{verbatim}
  5860.  to convert a text file b58polys.dat into a binary file b58polys.bdt and
  5861.  to view the content of the binary file by converting it back to text. At
  5862.  this time data through pipes must be in text. That is, the following is
  5863.  {\em illegal}:
  5864. @\begin{verbatim}
  5865.    dat2bin b58polys.dat | xglmdrvs -
  5866. @\end{verbatim}
  5867.  It should be remembered that the binary format is not documented and
  5868.  it might change in the future. Moreover, it is machine dependent and can
  5869.  very well may be unreadible between different platforms.
  5870. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5871. @\section{Dat2Irit - Data To IRIT file filter}
  5872. !DAT2IRIT - Data To IRIT file filter
  5873.   Converts '.dat' and '.bdt' data files to '.irt' {\em IRIT} scripts.
  5874. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5875. @\subsection{Command Line Options}
  5876. &Command line options
  5877. @\begin{verbatim}
  5878.    dat2irit [-z] DFiles
  5879. @\end{verbatim}
  5880. @\begin{itemize}
  5881. @\item
  5882.   {\bf -z}: Print version number and current defaults.
  5883. @\end{itemize}
  5884. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5885. @\subsection{Usage}
  5886. &Usage
  5887.     It may be sometimes desired to convert .dat data files into a form that
  5888.  can be fed back to {\em IRIT} - a '.irt' file. This filter does exactly that.
  5889.  Example:
  5890. @\begin{verbatim}
  5891.    dat2irit b58.dat > b58-new.irt
  5892. @\end{verbatim}
  5893. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5894. @\section{Dxf2Irit - DXF (Autocad) To IRIT filter}
  5895. !DXF2IRIT - DXF (Autocad) To IRIT filter
  5896.    Due to lack of real documentation on the DXF format (for surfaces), this
  5897.  filter is not really complete. It only work for polygons, and is provided
  5898.  here only for those desperate enough to try and fix it...
  5899. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5900. @\section{Irit2Dxf - IRIT To DXF (Autocad) filter}
  5901. !IRIT2DXF - IRIT To DXF (Autocad) filter
  5902.    Due to lack of real documentation on the DXF format (for surfaces), this
  5903.  filter is not really complete. It works only for polygons, and is provided
  5904.  here only for those desperate enough to try and fix it...
  5905. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5906. @\section{Irit2Iv - IRIT To SGI's Inventor filter}
  5907. !IRIT2IV - IRIT To SGI's Inventor filter
  5908.  IV is the format used by the Inventor modeling/rendering package from SGI.
  5909. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5910. @\subsection{Command Line Options}
  5911. &Command line options
  5912. @\begin{verbatim}
  5913.   irit2iv [-l] [-4] [-P] [-F PolyOpti FineNess] [-f PolyOpti SampPerCrv]
  5914.                                                              [-T] [-z] DFiles
  5915. @\end{verbatim}
  5916. @\begin{itemize}
  5917. @\item
  5918.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  5919.        by a single polygon along their linear direction.
  5920.        Although, most of the time, linear direction can be exactly represented
  5921.        using a single polygon, even a bilinear surface can have a free form
  5922.        shape (saddle like) that is not representable using a single polygon.
  5923.        Note that although this option will better emulate the surface shape,
  5924.        it will create unnecessary polygons in cases where one is enough.
  5925. @\item
  5926.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  5927. @\item
  5928.   {\bf -P}: Polygonize freeform shapes. Default is to leave freeform curves
  5929.        and surfaces as is.
  5930. @\item
  5931.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  5932.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  5933.        FineNess. See also -4.
  5934. @\item
  5935.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  5936.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  5937.         Otherwise, an adaptive subdivision that optimizes the samples is
  5938.         employed.
  5939. @\item
  5940.   {\bf -T}: Talkative mode. Prints processing information.
  5941. @\item
  5942.   {\bf -z}: Prints version number and current defaults.
  5943. @\end{itemize}
  5944. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5945. @\subsection{Usage}
  5946. &Usage
  5947.     Irit2Iv converts freeform surfaces and polygons into polygons and
  5948.  saved in iv Inventor's ascii file format.
  5949.  Example:
  5950. @\begin{verbatim}
  5951.  irit2iv solid1.dat > solid1.iv
  5952. @\end{verbatim}
  5953.     Surfaces are converted to polygons with fineness control:
  5954. @\begin{verbatim}
  5955.  irit2iv -F 0 16 - view.mat < saddle.dat > saddle.iv
  5956. @\end{verbatim}
  5957.     Note the use of '-' for stdin.
  5958. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5959. @\section{Irit2Nff - IRIT To NFF filter}
  5960. !IRIT2NFF - IRIT To NFF filter
  5961. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5962. @\subsection{Command Line Options}
  5963. &Command line options
  5964. @\begin{verbatim}
  5965.   irit2nff [-l] [-4] [-c] [-F PolyOpti FineNess] [-o OutName] [-T] [-g]
  5966.                                                                   [-z] DFiles
  5967. @\end{verbatim}
  5968. @\begin{itemize}
  5969. @\item
  5970.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  5971.        by a single polygon along their linear direction.
  5972.        Although, most of the time, linear direction can be exactly represented
  5973.        using a single polygon, even a bilinear surface can have a free-form
  5974.        shape (saddle-like) that is not representable using a single polygon.
  5975.        Note that although this option will better emulate the surface shape,
  5976.        it will create unnecessary polygons in cases where one is enough.
  5977. @\item
  5978.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  5979. @\item
  5980.   {\bf -c}: Output files should be filtered by cpp. When set, the usually
  5981.        huge geometry file is separated from the main nff file that contains
  5982.        the surface properties and view parameters. By default all data,
  5983.        including the geometry, are saved into a single file with type extension
  5984.        '.nff'. Use of '-c' will pull out all the geometry into a file with
  5985.        the same name but a '.geom' extension, which will be included using the
  5986.        '\#include' command. The '.nff' file should, in that case, be
  5987.        preprocessed using cpp before being piped into the nff renderer.
  5988. @\item
  5989.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  5990.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  5991.        FineNess. See also -4.
  5992. @\item
  5993.   {\bf -o OutName}: Name of output file. By default the name of the first data
  5994.        file from the {\em DFiles} list is used.  See below on the output files.
  5995. @\item
  5996.   {\bf -g}: Generates the geometry file only. See below.
  5997. @\item
  5998.   {\bf -T}: Talkative mode. Prints processing information.
  5999. @\item
  6000.   {\bf -z}: Prints version number and current defaults.
  6001. @\end{itemize}
  6002. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6003. @\subsection{Usage}
  6004. &Usage
  6005.     Irit2Nff converts freeform surfaces into polygons in a format that can
  6006.  be used by an NFF renderer. Usually, one file is created with '.nff' type
  6007.  extension. Since the number of polygons can be extremely large, a '-c'
  6008.  option is provided, which separates the geometry from the surface
  6009.  properties and view specification, but requires preprocessing by cpp.
  6010.  The geometry is isolated in a file with extension '.geom' and included
  6011.  (via '\#include') in the main '.nff' file. The latter holds the surface
  6012.  properties for all the geometry as well as the viewing specification.
  6013.  This allows for the changing of shading or the viewing properties while
  6014.  editing small ('.nff') files.
  6015.     If '-g' is specified, only the '.geom' file is created, preserving the
  6016.  current '.nff' file. The '-g' flag can be specified only with '-c'.
  6017.     In practice, it may be useful to create a low resolution approximation
  6018.  of the model, change viewing/shading parameters in the '.nff' file until
  6019.  a good view and/or surface quality is found, and then run Irit2Nff once more
  6020.  to create a high resolution approximation of the geometry using '-g'.
  6021.  Example:
  6022. @\begin{verbatim}
  6023.  irit2nff -c -l -F 0 8 b58.dat
  6024. @\end{verbatim}
  6025.  creates b58.nff and b58.geom with low resolution (FineNess of 5).
  6026.  Once done with parameter setting, a fine approximation of the model can
  6027.  be created with:
  6028. @\begin{verbatim}
  6029.  irit2nff -c -l -g -F 0 64 b58.dat
  6030. @\end{verbatim}
  6031.  which will only recreate b58.geom (because of the -g option).
  6032.  One can overwrite the viewing matrix by appending a new matrix in the
  6033.  end of the command line, created by a display device:
  6034. @\begin{verbatim}
  6035.  xgldrvs b58.dat
  6036.  irit2nff -l -F 0 32 b58.dat irit.mat
  6037. @\end{verbatim}
  6038.  where irit.mat is the viewing matrix created by xgldrvs.
  6039. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6040. @\subsection{Advanced Usage}
  6041. &Advanced Usage
  6042.    One can specify surface qualities for individual surfaces of a model.
  6043.  Several such attributes are supported by Irit2Nff and can be set within
  6044.  {\em IRIT}. See also the ATTRIB {\em IRIT} command.
  6045.    If a certain surface should be finer than the rest of the scene, one can
  6046.  set a "resolution" attribute which specifies the {\em relative} FineNess
  6047.  resolution of this specific surface.
  6048.  Example:
  6049. @\begin{verbatim}
  6050.  attrib( srf1, "resolution", 2 );
  6051. @\end{verbatim}
  6052.  will force srf1 to have twice the default resolution, as set via the '-f'
  6053.  flag.
  6054.    Almost flat patches are converted to polygons. The rectangle can be
  6055.  converted into two polygons (by subdividing along one of its diagonals) or
  6056.  into four by introducing a new point at the center of the patch. This
  6057.  behavior is controlled by the '-4' flag, but can be overwritten for
  6058.  individual surfaces by setting a "twoperflat" or a "fourperflat" attribute.
  6059.    NFF specific properties are controlled via the following attributes:
  6060.  "kd", "ks", "shine", "trans", "index". Refer to the NFF manual for detail.
  6061.  Example:
  6062. @\begin{verbatim}
  6063.  attrib( srf1, "kd", 0.3 );
  6064.  attrib( srf1, "shine", 30 );
  6065. @\end{verbatim}
  6066.    Surface color is controlled in two levels. If the object has an RGB
  6067.  attribute, it is used. Otherwise, a color, as set via the {\em IRIT} COLOR
  6068.  command, is used if set.
  6069.  Example:
  6070. @\begin{verbatim}
  6071.  attrib( tankBody, "rgb", "244,164,96" );
  6072. @\end{verbatim}
  6073. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6074. @\section{Irit2Plg - IRIT To PLG (REND386) filter}
  6075. !IRIT2PLG - IRIT To PLG (REND386) filter
  6076.  PLG is the format used by the rend386 real time renderer for the IBM PC.
  6077. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6078. @\subsection{Command Line Options}
  6079. &Command line options
  6080. @\begin{verbatim}
  6081.   irit2plg [-l] [-4] [-F PolyOpti FineNess] [-T] [-z] DFiles
  6082. @\end{verbatim}
  6083. @\begin{itemize}
  6084. @\item
  6085.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  6086.        by a single polygon along their linear direction.
  6087.        Although, most of the time, linear direction can be exactly represented
  6088.        using a single polygon, even a bilinear surface can have a free form
  6089.        shape (saddle like) that is not representable using a single polygon.
  6090.        Note that although this option will better emulate the surface shape,
  6091.        it will create unnecessary polygons in cases where one is enough.
  6092. @\item
  6093.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  6094. @\item
  6095.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  6096.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  6097.        FineNess. See also -4.
  6098. @\item
  6099.   {\bf -T}: Talkative mode. Prints processing information.
  6100. @\item
  6101.   {\bf -z}: Prints version number and current defaults.
  6102. @\end{itemize}
  6103. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6104. @\subsection{Usage}
  6105. &Usage
  6106.     Irit2Plg converts freeform surfaces and polygons into polygons in a
  6107.  format that can be used by the REND386 renderer. 
  6108.  Example:
  6109. @\begin{verbatim}
  6110.  irit2plg solid1.dat > solid1.plg
  6111. @\end{verbatim}
  6112.     Surfaces are converted to polygons with fineness control:
  6113. @\begin{verbatim}
  6114.  irit2plg -F 0 16 - view.mat < saddle.dat > saddle.plg
  6115. @\end{verbatim}
  6116.     Note the use of '-' for stdin.
  6117. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6118. @\section{Irit2Ps - IRIT To PS filter}
  6119. !IRIT2PS - IRIT To PS filter
  6120. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6121. @\subsection{Command Line Options}
  6122. &Command line options
  6123. @\begin{verbatim}
  6124.   irit2ps [-l] [-4] [-s Size] [-I #UIso[:#VIso[:#WIso]]] [-F PolyOpti FineNess]
  6125.           [-f PolyOpti SampPerCrv] [-M] [-G] [-P] [-W LineWidth]
  6126.           [-w WidenLen WidenWidth] [-b R G B] [-c] [-C] [-T] [-i] [-o OutName]
  6127.           [-d [Zmin Zmax]] [-D [Zmin Zmax]] [-p PtType PtSize] [-u] [-z] DFiles
  6128. @\end{verbatim}
  6129. @\begin{itemize}
  6130. @\item
  6131.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  6132.         by a single polygon along their linear direction.
  6133.          Although most of the time, linear direction can be exactly represented
  6134.         using a single polygon, even a bilinear surface can have a free-form
  6135.         shape (saddle-like) that is not representable using a single polygon.
  6136.           Note that although this option will better emulate the surface shape,
  6137.         it will create unnecessary polygons in cases where one is enough.
  6138. @\item
  6139.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  6140. @\item
  6141.   {\bf -s Size}: Controls the size of the postscript output in inches.
  6142.         Default is to fill the entire screen.
  6143. @\item
  6144.   {\bf -I \#UIso[:\#VIso[:\#WIso]]}: Specifies the number of isolines per
  6145.         surface/trivariate, per direction. If \#VIso or \#WIso is not
  6146.         specified, \#UIso is used for \#VIso etc.
  6147. @\item
  6148.   {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
  6149.         surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  6150.         FineNess. See also -4.
  6151. @\item
  6152.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  6153.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6154.         Otherwise, an adaptive subdivision that optimizes the samples is
  6155.         employed.
  6156. @\item
  6157.   {\bf -M}: Dumps the control mesh/polygon as well.
  6158. @\item
  6159.   {\bf -G}: Dumps the curve/surface (as freeform geometry). Default. See -I,
  6160.         -C, -f for control on polyline approximation.
  6161. @\item
  6162.   {\bf -P}: Dumps the curve/surface (as polygons). See -F, -l, -4 for control
  6163.         on polygonal approximation.
  6164. @\item
  6165.   {\bf -W \#LineWidth}: Sets the line drawing width in inches. Default is
  6166.         as thin as possible. This option will overwrite only those objects
  6167.         that do {\em not} have a "width" attribute. See also -d. If LineWidth
  6168.         is negative its absolute value is used to scale the current width
  6169.         of the object if has one, or the default width otherwise.
  6170. @\item
  6171.   {\bf -w WidenLen WidenWidth}: If end points of polylines should be made
  6172.         wider, and if so to what width.
  6173. @\item
  6174.   {\bf -b R G B}: Sets a colored background. RGB are three integers prescribing
  6175.         the Red, Green, and Blue coefficients. if no -c (i.e. a gray level
  6176.         drawing) this color is converted to a gray level using RGB to
  6177.         T.V. Y(IQ) channel conversion.
  6178. @\item
  6179.   {\bf -c}: Creates a {\em color} postscript file.
  6180. @\item
  6181.   {\bf -C}: Curve mode. Dumps freeform curves and surfaces as cubic
  6182.        Bezier curves. Higher order curves and surfaces and/or rationals are
  6183.        approximated by cubic Bezier curves. This option generates data
  6184.        files that are roughly a third of piecewise linear postscript files
  6185.        (by disabling this feature, -C-), but takes a longer time to compute.
  6186. @\item
  6187.   {\bf -T}: Talkative mode. Prints processing information.
  6188. @\item
  6189.   {\bf -i}: Internal edges (created by {\em IRIT}) - the default is not to
  6190.        display them, and this option will force displaying them as well.
  6191. @\item
  6192.   {\bf -o OutName}: Name of output file. Default is stdout.
  6193. @\item
  6194.   {\bf -d [Zmin Zmax]}: Sets the ratios between the depth cue and the width of
  6195.         the dumped data. See also -W, -p. Closer lines/points will be drawn
  6196.         wider/larger. Zmin and Zmax are optional. The object's bounding
  6197.         box is otherwise computed and used.
  6198. @\item
  6199.   {\bf -D [Zmin Zmax]}: Same as -d, but depth cue the color or gray scale
  6200.         instead of width. You might need to consider the sorting option
  6201.         of the illustrt tool (-s of illustrt) for proper drawings.
  6202.         Only one of -d and -D can be used.
  6203. @\item
  6204.   {\bf -p PtType PtSize}: Specifies the way points are drawn.
  6205.         PtType can be one of H, F, C for Hollow circle, Full Circle, or
  6206.         Cross. PtSize specifies the size of the point to be drawn, in inches.
  6207.         Vectors will also be drawn as points, but with an additional thin
  6208.         line to the origin. See also -d.
  6209. @\item
  6210.   {\bf -u}: Forces a unit matrix transformation, i.e. no transformation.
  6211. @\item
  6212.   {\bf -z}: Prints version number and current defaults.
  6213. @\end{itemize}
  6214. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6215. @\subsection{Usage}
  6216. &Usage
  6217.     Irit2Ps converts freeform surfaces and polygons into a postscript file.
  6218.  Example:
  6219. @\begin{verbatim}
  6220.  irit2ps solid1.dat > solid1.ps
  6221. @\end{verbatim}
  6222.     Surfaces are converted to polygons with fineness control:
  6223. @\begin{verbatim}
  6224.  irit2ps -f 0 32 -c -W 0.01 saddle.dat > saddle.ps
  6225. @\end{verbatim}
  6226.  creates a postscript file for the saddle model, in color, and with
  6227.  lines 0.01 inch thick.
  6228. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6229. @\subsection{Advanced Usage}
  6230. &Advanced Usage
  6231.    One can specify several attributes that affect the way the postscript
  6232.  file is generated. The attributes can be generated within {\em IRIT}.
  6233.  See also the ATTRIB {\em IRIT} command.
  6234.    If a certain object should be thinner or thicker than the rest of the scene,
  6235.  one can set a "width" attribute which specifies the line width in inches of
  6236.  this specific object.
  6237.  Example:
  6238. @\begin{verbatim}
  6239.  attrib( srf1, "width", 0.02 );
  6240. @\end{verbatim}
  6241.  will force srf1 to have this width, instead of the default as set via the
  6242.  '-W' flag.
  6243.  If a (closed) object, a polygon for example, needs to be filled, a "fill"
  6244.  attribute should be set, with a value equal to the gray level desired.
  6245.  Example:
  6246. @\begin{verbatim}
  6247.  attrib( poly, "fill", 0.5 );
  6248. @\end{verbatim}
  6249.  will fill poly with \%50 gray.
  6250.  If an object, a polygon for example, needs to be painted in a gray level
  6251.  instead of black, a "gray" attribute should be set, with a value equal
  6252.  to the gray level desired.
  6253.  Example:
  6254. @\begin{verbatim}
  6255.  attrib( poly, "gray", 0.5 );
  6256. @\end{verbatim}
  6257.  will draw poly with \%50 gray.
  6258.  Dotted or dashed line effects can be created using a "dash" attribute which
  6259.  is a direct PostScript dash string. A simple form of this string is "[a b]"
  6260.  in which a is the drawing portion (black) in inches, followed by b inches
  6261.  of white space. See the postScript manual for more about the format of this
  6262.  string. Here is an example for a dotted-dash line.
  6263. @\begin{verbatim}
  6264.  attrib( poly, "dash", "[0.006 0.0015 0.001 0.0015] 0" );
  6265. @\end{verbatim}
  6266.    Surface color is controlled (for color postscript only - see -c) in two
  6267.  levels. If the object has an RGB attribute, it is used. Otherwise, a color as
  6268.  set via the {\em IRIT} COLOR command is used.
  6269.  Example:
  6270. @\begin{verbatim}
  6271.  attrib( Ball, "rgb", "255,0,0" );
  6272. @\end{verbatim}
  6273.     An object can be drawn as ``tubes'' instead of full lines. The ratio
  6274.  between the inner and the outer radii of the tube is provided as the
  6275.  TUBULAR attribute:
  6276. @\begin{verbatim}
  6277.  attrib( final, "tubular", 0.7 );
  6278. @\end{verbatim}
  6279. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6280. @\section{Irit2Ray - IRIT To RAYSHADE filter}
  6281. !IRIT2RAY - IRIT To RAYSHADE filter
  6282. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6283. @\subsection{Command Line Options}
  6284. &Command line options
  6285. @\begin{verbatim}
  6286.   irit2ray [-l] [-4] [-G GridSize] [-F PolyOpti FineNess]
  6287.            [-f PolyOpti SampPerCrv] [-o OutName] [-g] [-p Zmin Zmax] [-P]
  6288.            [-M] [-T] [-I #UIso[:#VIso[:#WIso]]] [-s ObjSeq#] [-z] DFiles
  6289. @\end{verbatim}
  6290. @\begin{itemize}
  6291. @\item
  6292.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  6293.         by a single polygon along their linear direction.
  6294.          Although most of the time, linear direction can be exactly represented
  6295.         using a single polygon, even a bilinear surface can have a free-form
  6296.         shape (saddle-like) that is not representable using a single polygon.
  6297.           Note that although this option will better emulate the surface shape,
  6298.         it will create unnecessary polygons in cases where one is enough.
  6299. @\item
  6300.   {\bf -4}: Four - Generates four polygons per flat patch. Default is 2.
  6301. @\item
  6302.   {\bf -G GridSize}: Usually objects are grouped as {\em lists} of polygons.
  6303.         This flags will coerce the usage of the RAYSHADE {\em grid} structure,
  6304.         with {\em GridSize} being used as the grid size along the object
  6305.         bounding box's largest dimension.
  6306. @\item
  6307.   {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
  6308.         surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  6309.         FineNess. See also -4.
  6310. @\item
  6311.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  6312.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6313.         Otherwise, an adaptive subdivision that optimizes the samples is
  6314.         employed.
  6315. @\item
  6316.   {\bf -o OutName}: Name of output file. By default the name of the first data
  6317.         file from the {\em DFiles} list is used.  See below on the output
  6318.         files.
  6319. @\item
  6320.   {\bf -g}: Generates the geometry file only. See below.
  6321. @\item
  6322.   {\bf -p Zmin Zmax}: Sets the ratios between the depth cue and the width of
  6323.         the dumped {\em polylines}. See also -P. Closer lines will be drawn
  6324.         wider.
  6325. @\item
  6326.   {\bf -P}: Forces dumping polygons as polylines with thickness controlled
  6327.         by -p.
  6328. @\item
  6329.   {\bf -M}: If -P (see -P and -p) then converts the control mesh/polygon
  6330.         to polylines which are represented as a sequence of truncated
  6331.         cones.
  6332. @\item
  6333.   {\bf -T}: Talkative mode. Prints processing information.
  6334. @\item
  6335.   {\bf -I \#UIso[:\#VIso[:\#WIso]]}: Specifies the number of isolines per
  6336.         surface/trivariate, per direction. If \#VIso or \#WIso is not
  6337.         specified, \#UIso is used for \#VIso etc.
  6338. @\item
  6339.   {\bf -s ObjSeq\#}: Sets object sequence number if no object name. Default 1.
  6340. @\item
  6341.   {\bf -z}: Prints version number and current defaults.
  6342. @\end{itemize}
  6343. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6344. @\subsection{Usage}
  6345. &Usage
  6346.     Irit2Ray converts freeform surfaces into polygons in a format that can
  6347.  be used by RAYSHADE. Two files are created, one with a '.geom' extension and
  6348.  one with '.ray'. Since the number of polygons can be extremely large,
  6349.  the geometry is isolated in the '.geom' file and is included
  6350.  (via '\#include') in the main '.ray' file. The latter holds the surface
  6351.  properties for all the geometry as well as viewing and RAYSHADE specific
  6352.  commands. This allows for the changing of the shading or the viewing
  6353.  properties while editing small ('.ray') files.
  6354.     If '-g' is specified, only the '.geom' file is created, preserving the
  6355.  current '.ray' file.
  6356.     In practice, it may be useful to create a low resolution approximation
  6357.  of the model, change the viewing/shading parameters in the '.ray' file until
  6358.  a good view and/or surface quality is found, and then run Irit2Ray once more
  6359.  to create a high resolution approximation of the geometry using '-g'.
  6360.  Example:
  6361. @\begin{verbatim}
  6362.  irit2ray -l -F 0 8 b58.dat
  6363. @\end{verbatim}
  6364.  creates b58.ray and b58.geom with low resolution (FineNess of 5).
  6365.    At such low resolution it can very well may happen that triangles will have
  6366.  normals "over the edge" since a single polygon may approximate a highly
  6367.  curved surface. That will cause RAYSHADE to issue an
  6368.  "Inconsistent triangle normals" warning. This problem will not exist if
  6369.  high fineness is used.
  6370.    One can ray trace this scene using a command similar to:
  6371. @\begin{verbatim}
  6372.  RAYSHADE -p -W 256 256 b58.ray > b58.rle
  6373. @\end{verbatim}
  6374.  Once done with parameter setting for RAYSHADE, a fine approximation of the
  6375.  model can be created with:
  6376. @\begin{verbatim}
  6377.  irit2ray -l -g -F 0 64 b58.dat
  6378. @\end{verbatim}
  6379.  which will only recreate b58.geom (because of the -g option).
  6380.  Interesting effects can be created using the depth cue support and polyline
  6381.  conversion of irit2ray. For example
  6382. @\begin{verbatim}
  6383.  irit2ray -G 5 -P -p -0.0 0.5 solid1.dat
  6384. @\end{verbatim}
  6385.  will dump solid1 as a set of polylines (represented as truncated cones in
  6386.  RAYSHADE) with varying thickness according to the $z$ depth. Another example
  6387. @\begin{verbatim}
  6388.  irit2ray -G 5 -P -p -0.1 1.0 saddle.dat
  6389. @\end{verbatim}
  6390.  which dumps the isolines extracted from the saddle surface with varying
  6391.  thickness.
  6392.    Each time a data file is saved in {\em IRIT}, it can be saved with the
  6393.  viewing matrix of the last INTERACT by saving the VIEW\_MAT object as well.
  6394.  I.e.:
  6395. @\begin{verbatim}
  6396.  save( "b58", b58 );
  6397. @\end{verbatim}
  6398.    However one can overwrite the viewing matrix by appending a new matrix
  6399.  in the end of the command line, created by the display devices:
  6400. @\begin{verbatim}
  6401.  os2drvs b58.dat
  6402.  irit2ray -l -F 0 16 b58.dat irit.mat
  6403. @\end{verbatim}
  6404.  where irit.mat is the viewing matrix created by os2drvs. The output name,
  6405.  by default, is the last input file name, so you might want to provide an
  6406.  explicit name with the -o flag.
  6407. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6408. @\subsection{Advanced Usage}
  6409. &Advanced Usage
  6410.    One can specify surface qualities for individual surfaces of a model.
  6411.  Several such attributes are supported by Irit2Ray and can be set within
  6412.  {\em IRIT}. See also the ATTRIB {\em IRIT} command.
  6413.    If a certain surface should be finer than the rest of the scene, one can
  6414.  set a "resolution" attribute which specifies the {\em relative} FineNess
  6415.  resolution of this specific surface.
  6416.  Example:
  6417. @\begin{verbatim}
  6418.  attrib( srf1, "resolution", 2 );
  6419. @\end{verbatim}
  6420.  will force srf1 to have twice the default resolution, as set via the '-f'
  6421.  flag.
  6422.    Almost flat patches are converted to polygons. The rectangle can be
  6423.  converted into two polygons (by subdividing along one of its diagonals) or
  6424.  into four by introducing a new point at the patch center. This behavior is
  6425.  controlled by the '-4' flag, but can be overwritten for individual surfaces
  6426.  bu setting "twoperflat" or "fourperflat".
  6427.    RAYSHADE specific properties are controlled via the following attributes:
  6428.  "specpow", "reflect", "transp", "body", "index", and "texture". The value of
  6429.  this attributes must be strings as it is copied verbatim. Refer to
  6430.  RAYSHADE's manual for their meaning.
  6431.   Example:
  6432. @\begin{verbatim}
  6433.  attrib( srf1, "transp", "0.3" );
  6434.  attrib( srf1, "texture", "wood" );
  6435. @\end{verbatim}
  6436.    Surface color is controlled in two levels. If the object has an RGB
  6437.  attribute, it is used. Otherwise a color as set via the {\em IRIT} COLOR
  6438.  command is being used if set.
  6439.  Example:
  6440. @\begin{verbatim}
  6441.  attrib( tankBody, "rgb", "244,164,96" );
  6442. @\end{verbatim}
  6443. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6444. @\section{Irit2Scn - IRIT To SCENE (RTrace) filter}
  6445. !IRIT2Scn - IRIT To SCENE (RTrace) filter
  6446.  SCENE is the format used by the RTrace ray tracer. This filter was donated
  6447.  by Antonio Costa (acc@asterix.inescn.pt), the author of RTrace.
  6448. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6449. @\subsection{Command Line Options}
  6450. &Command line options
  6451. @\begin{verbatim}
  6452.   irit2scn [-l] [-4] [-F PolyOpti FineNess] [-o OutName] [-g] [-T] [-z] DFiles
  6453. @\end{verbatim}
  6454. @\begin{itemize}
  6455. @\item
  6456.   {\bf -l}: Linear - forces linear (degree two) surfaces to be approximated
  6457.        as a single polygon along their linear direction.
  6458.          Although most of the time, linear direction can be exactly represented
  6459.        using a single polygon, even a bilinear surface can have a free-form
  6460.        shape (saddle-like) that is not representable using a single polygon.
  6461.          Note that although this option will better emulate the surface shape,
  6462.        it will create unnecessary polygons in cases where one is enough.
  6463. @\item
  6464.   {\bf -4}: Four - Generates four polygons per flat patch.
  6465. @\item
  6466.   {\bf -F PolyOpti FineNess}: Optimality of polygonal approximation of
  6467.        surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  6468.        FineNess. See also -4.
  6469. @\item
  6470.   {\bf -o OutName}: Name of output file. By default the name of the first data
  6471.        file from {\em DFiles} list is used.  See below on the output files.
  6472. @\item
  6473.   {\bf -g}: Generates the geometry file only. See below.
  6474. @\item
  6475.   {\bf -T}: Talkative mode. Prints processing information.
  6476. @\item
  6477.   {\bf -z}: Prints version number and current defaults.
  6478. @\end{itemize}
  6479. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6480. @\subsection{Usage}
  6481. &Usage
  6482.     Irit2Scn converts freeform surfaces and polygons into polygons in a format
  6483.  that can be used by RTrace. Two files are created, one with a '.geom'
  6484.  extension and one with '.scn'. Since the number of polygons can be extremely
  6485.  large, the geometry is isolated in the '.geom' file and is included
  6486.  (via '\#include') in the main '.scn' file. The latter holds the surface
  6487.  properties for all the geometry as well as viewing and RTrace specific
  6488.  commands. This allows for the changing of the shading or the viewing
  6489.  properties while editing small ('.scn') files.
  6490.     If '-g' is specified, only the '.geom' file is created, preserving the
  6491.  current '.scn' file.
  6492.     In practice, it may be useful to create a low resolution approximation
  6493.  of the model, change the viewing/shading parameters in the '.scn' file
  6494.  until a good view and/or surface quality is found, and then run Irit2Scn once
  6495.  more to create a high resolution approximation of the geometry using '-g'.
  6496.  Example:
  6497. @\begin{verbatim}
  6498.  irit2scn -l -F 0 8 b58.dat
  6499. @\end{verbatim}
  6500.  creates b58.scn and b58.geom with low resolution (FineNess of 5).
  6501.    One can ray trace this scene after converting the scn file to a sff file,
  6502.  using scn2sff provided with the RTrace package.
  6503.  Once done with the parameter setting of RTrace, a fine approximation of the
  6504.  model can be created with:
  6505. @\begin{verbatim}
  6506.  irit2scn -l -g -F 0 64 b58.dat
  6507. @\end{verbatim}
  6508.  which will only recreate b58.geom (because of the -g option).
  6509.    One can overwrite the viewing matrix by appending a new matrix
  6510.  in the end of the command line, created by the display devices:
  6511. @\begin{verbatim}
  6512.  wntdrvs b58.dat
  6513.  irit2scn -l -F 0 8 b58.dat irit.mat
  6514. @\end{verbatim}
  6515.  where irit.mat is the viewing matrix created by wntdrvs. The output name,
  6516.  by default, is the last input file name, so you might want to provide an
  6517.  explicit name with the -o flag.
  6518. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6519. @\subsection{Advanced Usage}
  6520. &Advanced Usage
  6521.    One can specify surface qualities for individual surfaces of a model.
  6522.  Several such attributes are supported by Irit2Scn and can be set within 
  6523.  {\em IRIT}. See also the ATTRIB {\em IRIT} command.
  6524.    If a certain surface should be finer than the rest of the scene, one can
  6525.  set a "resolution" attribute which specifies the {\em relative} FineNess
  6526.  resolution of this specific surface.
  6527.  Example:
  6528. @\begin{verbatim}
  6529.  attrib( srf1, "resolution", 2 );
  6530. @\end{verbatim}
  6531.  will force srf1 to have twice the default resolution, as set via the '-f'
  6532.  flag.
  6533.    Almost flat patches are converted to polygons. The patch can be converted
  6534.  into two polygons (by subdividing along one of its diagonals) or into four
  6535.  by introducing a new point at the patch center. This behavior is controlled
  6536.  by the '-4' flag, but can be overwritten for individual surfaces bu setting
  6537.  "twoperflat" or "fourperflat".
  6538.    RTrace specific properties are controlled via the following attributes:
  6539.  "SCNrefraction", "SCNtexture", "SCNsurface. Refer to the RTrace manual for
  6540.  their meaning.
  6541.  Example:
  6542. @\begin{verbatim}
  6543.  attrib( srf1, "SCNrefraction", 0.3 );
  6544. @\end{verbatim}
  6545.    Surface color is controlled in two levels. If the object has an RGB
  6546.  attribute, it is used. Otherwise a color as set via {\em IRIT} COLOR command
  6547.  is used if set.
  6548.  Example:
  6549. @\begin{verbatim}
  6550.  attrib( tankBody, "rgb", "244,164,96" );
  6551. @\end{verbatim}
  6552. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6553. @\section{Irit2Xfg - IRIT To XFIG filter}
  6554. !IRIT2Xfg - IRIT To XFIG filter
  6555. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6556. @\subsection{Command Line Options}
  6557. &Command line options
  6558. @\begin{verbatim}
  6559.   irit2xfg [-s Size] [-t XTrans YTrans] [-I #UIso[:#VIso[:#WIso]]]
  6560.        [-f PolyOpti SampPerCrv] [-F PolyOpti FineNess] [-M] [-G] [-T]
  6561.        [-i] [-o OutName] [-z] DFiles
  6562. @\end{verbatim}
  6563. @\begin{itemize}
  6564. @\item
  6565.   {\bf -s Size}: Size in inches of the page. Default is 7 inches.
  6566. @\item
  6567.   {\bf -t XTrans YTrans}: X and Y translation. of the image. Default is (0, 0).
  6568. @\item
  6569.   {\bf -I \#UIso[:\#VIso]}: Specifies the number of isolines per surface, per
  6570.         direction. If \#VIso is not specified, \#UIso is used for \#VIso as
  6571.         well.
  6572. @\item
  6573.   {\bf -f PolyOpti SampPerCrv}: Controls the method used to approximate curves
  6574.         into polylines. If PolyOpti == 0, equally spaced intervals are used.
  6575.         Otherwise, an adaptive subdivision that optimizes the samples is
  6576.         employed.
  6577. @\item
  6578.   {\bf -F PolygonOpti FineNess}: Optimality of polygonal approximation of
  6579.         surfaces. See the variable POLY\_APPROX\_OPT for the meaning of
  6580.         FineNess. See also -4. This enforces the dump of freefrom geometry
  6581.         as polygons.
  6582. @\item
  6583.   {\bf -M}: Dumps the control mesh/polygon as well.
  6584. @\item
  6585.   {\bf -G}: Dumps the freeform geometry.
  6586. @\item
  6587.   {\bf -T}: Talkative mode. Prints processing information.
  6588. @\item
  6589.   {\bf -i}: Internal edges (created by {\em IRIT}) - default is not to
  6590.        display them, and this option will force displaying them as well.
  6591. @\item
  6592.   {\bf -o OutName}: Name of output file. By default the name of the first data
  6593.        file from {\em DFiles} list is used.  See below on the output files.
  6594. @\item
  6595.   {\bf -z}: Prints version number and current defaults.
  6596. @\end{itemize}
  6597. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6598. @\subsection{Usage}
  6599. &Usage
  6600.     Irit2Xfg converts freeform surfaces and polygons into polylines in a format
  6601.  that can be used by XFIG.
  6602.  Example:
  6603. @\begin{verbatim}
  6604.  irit2Xfg -l -f 0 16  saddle.dat > saddle.xfg
  6605. @\end{verbatim}
  6606.    However, one can overwrite the viewing matrix by appending a new matrix
  6607.  in the end of the command line, created by the display devices:
  6608. @\begin{verbatim}
  6609.  x11drvs b58.dat
  6610.  irit2Xfg -l -f 0 16 b58.dat irit.mat > saddle.xfg
  6611. @\end{verbatim}
  6612.  where irit.mat is the viewing matrix created by x11drvs.
  6613. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6614. @\section{Data File Format}
  6615. !DATAFILE Format
  6616.    This section describes the data file format used to exchange data between
  6617.  {\em IRIT} and its accompanying tools.
  6618. @\begin{verbatim}
  6619.  [OBJECT {ATTRS} OBJNAME
  6620.      [NUMBER n]
  6621.    | [VECTOR x y z]
  6622.    | [CTLPT POINT_TYPE {w} x y {z}]
  6623.    | [STRING "a string"]
  6624.    | [MATRIX m00 ... m03
  6625.              m10 ... m13
  6626.              m20 ... m23
  6627.              m30 ... m33]
  6628.      ;A polyline should be drawn from first point to last. Nothing is drawn
  6629.      ;from last to first (in a closed polyline, last point is equal to first).
  6630.    | [POLYLINE {ATTRS} #PTS                   ;#PTS = number of points.
  6631.          [{ATTRS} x y z]
  6632.          [{ATTRS} x y z]
  6633.             .
  6634.             .
  6635.             .
  6636.          [{ATTRS} x y z]
  6637.      ]
  6638.      ;Defines a closed planar region. Last point is NOT equal to first,
  6639.      ;and a line from last point to first should be drawn when the boundary
  6640.      ;of the polygon is drawn.
  6641.    | [POLYGON {ATTRS} #PTS
  6642.          [{ATTRS} x y z]
  6643.          [{ATTRS} x y z]
  6644.             .
  6645.             .
  6646.             .
  6647.          [{ATTRS} x y z]
  6648.      ]
  6649.      ;Defines a "cloud" of points.
  6650.    | [POINTLIST {ATTRS} #PTS
  6651.          [{ATTRS} x y z]
  6652.          [{ATTRS} x y z]
  6653.             .
  6654.             .
  6655.             .
  6656.          [{ATTRS} x y z]
  6657.      ]
  6658.      ;Defines a Bezier curve with #PTS control points. If the curve is
  6659.      ;rational, the rational component is introduced first.
  6660.    | [CURVE BEZIER {ATTRS} #PTS POINT_TYPE
  6661.          [{ATTRS} {w} x y z ...]
  6662.          [{ATTRS} {w} x y z ...]
  6663.             .
  6664.             .
  6665.             .
  6666.          [{ATTRS} {w} x y z ...]
  6667.      ]
  6668.      ;Defines a Bezier surface with #UPTS * #VPTS control points. If the
  6669.      ;surface is rational, the rational component is introduced first.
  6670.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  6671.    | [SURFACE BEZIER {ATTRS} #UPTS #VPTS POINT_TYPE
  6672.          [{ATTRS} {w} x y z ...]
  6673.          [{ATTRS} {w} x y z ...]
  6674.             .
  6675.             .
  6676.             .
  6677.          [{ATTRS} {w} x y z ...]
  6678.      ]
  6679.      ;Defines a Bezier trivariate with #UPTS * #VPTS * #WPTS control
  6680.      ;points. If the trivariate is rational, the rational component is
  6681.      ;introduced first. Points are printed row after row (#UPTS per row),
  6682.      ;#VPTS rows, #WPTS layers (depth).
  6683.    | [TRIVAR BEZIER {ATTRS} #UPTS #VPTS #WPTS POINT_TYPE
  6684.          [{ATTRS} {w} x y z ...]
  6685.          [{ATTRS} {w} x y z ...]
  6686.             .
  6687.             .
  6688.             .
  6689.          [{ATTRS} {w} x y z ...]
  6690.      ]
  6691.      ;Defines a Bspline curve of order ORDER with #PTS control points. If the
  6692.      ;curve is rational, the rational component is introduced first.
  6693.      ;Note length of knot vector is equal to #PTS + ORDER.
  6694.      ;If curve is periodic KVP prefix the knot vector that has length of
  6695.      ;'Length + Order + Order - 1'.
  6696.    | [CURVE BSPLINE {ATTRS} #PTS ORDER POINT_TYPE
  6697.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                    ;Knot vector
  6698.          [{ATTRS} {w} x y z ...]
  6699.          [{ATTRS} {w} x y z ...]
  6700.             .
  6701.             .
  6702.             .
  6703.          [{ATTRS} {w} x y z ...]
  6704.      ]
  6705.      ;Defines a Bspline surface with #UPTS * #VPTS control points, of order
  6706.      ;UORDER by VORDER. If the surface is rational, the rational component
  6707.      ;is introduced first.
  6708.      ;Points are printed row after row (#UPTS per row), #VPTS rows.
  6709.      ;If surface is periodic in some direction KVP prefix the knot vector
  6710.      ;that has length of 'Length + Order + Order - 1'.
  6711.    | [SURFACE BSPLINE {ATTRS} #UPTS #VPTS UORDER VORDER POINT_TYPE
  6712.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  6713.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  6714.          [{ATTRS} {w} x y z ...]
  6715.          [{ATTRS} {w} x y z ...]
  6716.             .
  6717.             .
  6718.             .
  6719.          [{ATTRS} {w} x y z ...]
  6720.      ]
  6721.      ;Defines a Bspline trivariate with #UPTS * #VPTS * #WPTS control
  6722.      ;points. If the trivariate is rational, the rational component is
  6723.      ;introduced first. Points are printed row after row (#UPTS per row),
  6724.      ;#VPTS rows, #WPTS layers (depth).
  6725.      ;If trivariate is periodic in some direction KVP prefix the knot vector
  6726.      ;that has length of 'Length + Order + Order - 1'.
  6727.    | [TRIVAR BSPLINE {ATTRS} #UPTS #VPTS #WPTS UORDER VORDER WORDER POINT_TYPE
  6728.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;U Knot vector
  6729.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;V Knot vector
  6730.          [KV{P} {ATTRS} kv0 kv1 kv2 ...]                ;W Knot vector
  6731.          [{ATTRS} {w} x y z ...]
  6732.          [{ATTRS} {w} x y z ...]
  6733.             .
  6734.             .
  6735.             .
  6736.          [{ATTRS} {w} x y z ...]
  6737.      ]
  6738.      ;Defines a trimmed surface. Encapsulates a surface (can be either a
  6739.      ;Bspline or a Bezier surface) and prescribes its trimming curves.
  6740.      ;There can be an arbitrary number of trimming curves (either Bezier
  6741.      ; or Bspline). Each trimming curve contains an arbitrary number of
  6742.      ;trimming curve segments, while each trimming curve segment contains
  6743.      ;a parameteric representation optionally followed by a Euclidean
  6744.      ;representation of the trimming curve segment.
  6745.    | [TRIMSRF
  6746.          [SURFACE ...
  6747.          ]
  6748.          [TRIMCRV
  6749.              [TRIMCRVSEG
  6750.                  [CURVE ...
  6751.                  ]
  6752.              ]
  6753.                 .
  6754.                 .
  6755.                 .
  6756.              [TRIMCRVSEG
  6757.                  [CURVE ...
  6758.                  ]
  6759.              ]
  6760.          ]
  6761.              .
  6762.              .
  6763.              .
  6764.          [TRIMCRV
  6765.              [TRIMCRVSEG
  6766.                  [CURVE ...
  6767.                  ]
  6768.              ]
  6769.                 .
  6770.                 .
  6771.                 .
  6772.              [TRIMCRVSEG
  6773.                  [CURVE ...
  6774.                  ]
  6775.              ]
  6776.          ]
  6777.      ]
  6778.  POINT_TYPE -> E1 | E2 | E3 | E4 | E5 | P1 | P2 | P3 | P4 | P5
  6779.  ATTRS -> [ATTRNAME ATTRVALUE]
  6780.           | [ATTRNAME]
  6781.           | [ATTRNAME ATTRVALUE] ATTRS
  6782. @\end{verbatim}
  6783.  Some notes:
  6784.  * This definition for the text file is designed to minimize the
  6785.    reading time and space. All information can be read without backward
  6786.    or forward referencing.
  6787.  * An OBJECT must noever hold different geometry or other entities.
  6788.    I.e. CURVEs, SURFACEs, and POLYGONs must all be in different OBJECTs.
  6789.  * Attributes should be ignored if not needed. The attribute list may have
  6790.    any length and is always terminated by a token that is NOT '\verb+[+'. This
  6791.    simplifies and disambiguates the parsing.
  6792.  * Comments may appear between '\verb+[+OBJECT ...\verb+]+' blocks, or
  6793.    immediately after OBJECT OBJNAME, and only there.
  6794.    A comment body can be anything not containing the '\verb+[+' or the
  6795.    '\verb+]+' tokens (signals start/end of block). Some of the comments in
  6796.    the above definition are {\em illegal} and appear there only of the sake
  6797.    of clarity.
  6798.  * It is preferred that geometric attributes such as NORNALs will be saved in
  6799.    the geometry structure level (POLYGON, CURVE or vertices) while graphical
  6800.    and others such as COLORs will be saved in the OBJECT level.
  6801.  * Objects may be contained in other objects to an arbitrary level.
  6802.  Here is an example that exercises most of the data format:
  6803. @\begin{verbatim}
  6804.  This is a legal comment in a data file.
  6805.  [OBJECT DEMO
  6806.      [OBJECT REAL_NUM
  6807.          And this is also a legal comment.
  6808.          [NUMBER 4]
  6809.      ]
  6810.      [OBJECT A_VECTOR
  6811.          [VECTOR 1 2 3]
  6812.      ]
  6813.      [OBJECT CTL_POINT
  6814.          [CTLPT E3 1 2 3]
  6815.      ]
  6816.      [OBJECT STR_OBJ
  6817.          [STRING "string"]
  6818.      ]
  6819.      [OBJECT UNIT_MAT
  6820.          [MATRIX
  6821.             1 0 0 0
  6822.             0 1 0 0
  6823.             0 0 1 0
  6824.             0 0 0 1
  6825.          ]
  6826.      ]
  6827.      [OBJECT [COLOR 4] POLY1OBJ
  6828.          [POLYGON [PLANE 1 0 0 0.5] 4
  6829.              [-0.5 0.5 0.5]
  6830.              [-0.5 -0.5 0.5]
  6831.              [-0.5 -0.5 -0.5]
  6832.              [-0.5 0.5 -0.5]
  6833.          ]
  6834.          [POLYGON [PLANE 0 -1 0 0.5] 4
  6835.              [0.5 0.5 0.5]
  6836.              [-0.5 0.5 0.5]
  6837.              [-0.5 0.5 -0.5]
  6838.              [0.5 0.5 -0.5]
  6839.          ]
  6840.      ]
  6841.      [OBJECT [COLOR 63] ACURVE
  6842.          [CURVE BSPLINE 16 4 E2
  6843.              [KV 0 0 0 0 1 1 1 2 3 4 5 6 7 8 9 10 11 11 11 11]
  6844.              [0.874 0]
  6845.              [0.899333 0.0253333]
  6846.              [0.924667 0.0506667]
  6847.              [0.95 0.076]
  6848.              [0.95 0.76]
  6849.              [0.304 1.52]
  6850.              [0.304 1.9]
  6851.              [0.494 2.09]
  6852.              [0.722 2.242]
  6853.              [0.722 2.318]
  6854.              [0.38 2.508]
  6855.              [0.418 2.698]
  6856.              [0.57 2.812]
  6857.              [0.57 3.42]
  6858.              [0.19 3.572]
  6859.              [0 3.572]
  6860.          ]
  6861.      ]
  6862.      [OBJECT [COLOR 2] SOMESRF
  6863.          [SURFACE BEZIER 3 3 E3
  6864.              [0 0 0]
  6865.              [0.05 0.2 0.1]
  6866.              [0.1 0.05 0.2]
  6867.              [0.1 -0.2 0]
  6868.              [0.15 0.05 0.1]
  6869.              [0.2 -0.1 0.2]
  6870.              [0.2 0 0]
  6871.              [0.25 0.2 0.1]
  6872.              [0.3 0.05 0.2]
  6873.          ]
  6874.      ]
  6875. @\end{verbatim}
  6876. @\section{Bugs and Limitations}
  6877. !BUGS and LIMITATIONS
  6878.    Like any program of more than one line, it is far from being perfect.
  6879.  Some limitations, as well as simplifications, are laid out below.
  6880.  *  If the intersection curve of two objects falls exactly on polygon
  6881.     boundaries, for all polygons, the system will scream that the two objects
  6882.     do not intersect at all. Try to move one by EPSILON into the other.
  6883.     I probably should fix this one - it is supposed to be relatively easy.
  6884.  *  Avoid degenerate intersections that result with a point or a line.
  6885.     They will probably cause wrong propagation of the inner and outer part of
  6886.     one object relative to the other. Always extend your object beyond the
  6887.     other object.
  6888.  *  If two objects have no intersection in their boundary, {\em IRIT} assumes they
  6889.     are disjoint: a union simply combines them, and the other Boolean
  6890.     operators return a NULL object. One should find a FAST way (3D Jordan
  6891.     theorem) to find the relation between the two (A in B, B in A, A
  6892.     disjoint B) and according to that, make a decision.
  6893.  *  Since the boolean sum implementation constructs ruled surfaces with
  6894.     uniform speed, it might return a somewhat incorrect answer, given
  6895.     non-uniform input curves.
  6896.  *  The parser is out of hand and is difficult to maintain. There are several
  6897.     memory leaks there that one should fix.
  6898.  *  The X11 driver has no menu support (any easy way to have menus using
  6899.     Xlib!?).
  6900.  *  IBM R6000 fails to run the drivers in -s- mode.
  6901.  *  Rayshade complains a lot about degenerate polygons on irit2ray output.
  6902.     To alleviate the problem, change the 'equal' macro in common.h in libcommon
  6903.     of rayshade from EPSILON (1e-5) to 1e-7 or even lower.
  6904.  *  On the motif-based drivers (xmtdrvs etc.) clicking the mouse left and
  6905.     right of the scale's button produces stepped transformations. This
  6906.     step size is constant, and is not proportional to the distance between
  6907.     the mouse's position and the position of the button. The reason for the
  6908.     flaw is incorrect callback information returned from the scale in
  6909.     repeattive mode.
  6910.  *  Binary data files are not documented, nor will they be. They might
  6911.     change in the future and are in fact machine dependend. Hence, one
  6912.     platform might fail to read the other's binary data file.
  6913. @\end{document}
  6914.